File tree Expand file tree Collapse file tree 2 files changed +27
-1
lines changed
Expand file tree Collapse file tree 2 files changed +27
-1
lines changed Original file line number Diff line number Diff line change 1- 0545_add_pending_column
1+ 0546_update_permissions_enum
Original file line number Diff line number Diff line change 1+ """
2+ Create Date: 2026-03-19 11:15:54.687868
3+ """
4+
5+ from alembic import op
6+ from sqlalchemy import text
7+
8+ revision = '0546_update_permissions_enum'
9+ down_revision = '0545_add_pending_column'
10+
11+
12+ def upgrade ():
13+ conn = op .get_bind ()
14+ conn .execute (text ("SET lock_timeout = '1s'" ))
15+ conn .execute (text ("SET statement_timeout = '5s'" ))
16+
17+ # This will only run if send_files_via_ui is not present as an enum label
18+ stmt = "Select 1 from pg_enum as e JOIN pg_type as t ON e.enumtypid=t.oid WHERE e.enumlabel='send_files_via_ui' and t.typname='permission_types'"
19+ exists = conn .execute (text (stmt )).scalar_one_or_none ()
20+
21+ if not exists :
22+ conn .execute (text ("ALTER TYPE permission_types ADD VALUE 'send_files_via_ui'" ))
23+
24+
25+ def downgrade ():
26+ pass
You can’t perform that action at this time.
0 commit comments