-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathad13850a7245_ui_flip_project_icon.py
More file actions
46 lines (35 loc) · 1.16 KB
/
ad13850a7245_ui_flip_project_icon.py
File metadata and controls
46 lines (35 loc) · 1.16 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
"""Ui flip & project icon
Revision ID: ad13850a7245
Revises: 96fbb404381e
Create Date: 2025-06-23 11:35:12.693674
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = "ad13850a7245"
down_revision = "96fbb404381e"
branch_labels = None
depends_on = None
def upgrade():
connection = op.get_bind()
# ### commands auto generated by Alembic - please adjust! ###
op.add_column(
"user", sa.Column("use_new_cognition_ui", sa.Boolean(), nullable=True)
)
op.add_column(
"project", sa.Column("icon", sa.String(), nullable=True), schema="cognition"
)
# ### end Alembic commands ###
update_dataset_sql = """
UPDATE cognition.project
SET icon = 'IconBolt';"""
connection.execute(update_dataset_sql)
update_dataset_sql = """
UPDATE public.user
SET use_new_cognition_ui = FALSE; """
connection.execute(update_dataset_sql)
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_column("project", "icon", schema="cognition")
op.drop_column("user", "use_new_cognition_ui")
# ### end Alembic commands ###