From 22602d8a483a11b86818b0b691996a78bee707d8 Mon Sep 17 00:00:00 2001 From: Sandro Mani Date: Fri, 27 Oct 2023 14:48:40 +0200 Subject: [PATCH] Add expires column to permalinks table --- ..._add_expires_column_to_permalinks_table.py | 34 +++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 alembic/versions/0307976d3d52_add_expires_column_to_permalinks_table.py diff --git a/alembic/versions/0307976d3d52_add_expires_column_to_permalinks_table.py b/alembic/versions/0307976d3d52_add_expires_column_to_permalinks_table.py new file mode 100644 index 0000000..94eddb7 --- /dev/null +++ b/alembic/versions/0307976d3d52_add_expires_column_to_permalinks_table.py @@ -0,0 +1,34 @@ +"""add expires column to permalinks table + +Revision ID: 0307976d3d52 +Revises: d397557cf130 +Create Date: 2023-10-26 19:18:52.896721 + +""" +from alembic import op +import sqlalchemy as sa + + +# revision identifiers, used by Alembic. +revision = '0307976d3d52' +down_revision = 'd397557cf130' +branch_labels = None +depends_on = None + + +def upgrade(): + sql = sa.sql.text(""" + ALTER TABLE qwc_config.permalinks + ADD COLUMN expires date; + """) + conn = op.get_bind() + conn.execute(sql) + + +def downgrade(): + sql = sa.sql.text(""" + ALTER TABLE qwc_config.user_infos + DROP COLUMN expires; + """) + conn = op.get_bind() + conn.execute(sql)