Skip to content

Commit b4876c6

Browse files
committed
Add bd84e7f12b72_add_permitted_group_to_permalinks_table.py migration
1 parent 41a332b commit b4876c6

File tree

1 file changed

+36
-0
lines changed

1 file changed

+36
-0
lines changed
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
"""Add permitted_group to permalinks table
2+
3+
Revision ID: bd84e7f12b72
4+
Revises: b4b1291b2628
5+
Create Date: 2025-03-18 17:57:03.630566
6+
7+
"""
8+
import os
9+
from alembic import op
10+
import sqlalchemy as sa
11+
12+
qwc_config_schema = os.getenv("QWC_CONFIG_SCHEMA", "qwc_config")
13+
14+
# revision identifiers, used by Alembic.
15+
revision = 'bd84e7f12b72'
16+
down_revision = 'b4b1291b2628'
17+
branch_labels = None
18+
depends_on = None
19+
20+
21+
def upgrade():
22+
sql = sa.sql.text("""
23+
ALTER TABLE {schema}.permalinks
24+
ADD COLUMN permitted_group text;
25+
""".format(schema=qwc_config_schema))
26+
conn = op.get_bind()
27+
conn.execute(sql)
28+
29+
30+
def downgrade():
31+
sql = sa.sql.text("""
32+
ALTER TABLE {schema}.user_infos
33+
DROP COLUMN permitted_group;
34+
""".format(schema=qwc_config_schema))
35+
conn = op.get_bind()
36+
conn.execute(sql)

0 commit comments

Comments
 (0)