Skip to content

Commit b898dc1

Browse files
merge master
1 parent 1dffca2 commit b898dc1

File tree

1 file changed

+45
-0
lines changed

1 file changed

+45
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
"""add group_by_flag col to comp_runs
2+
3+
Revision ID: 73fd9c8b8a1d
4+
Revises: 4f6fd2586491
5+
Create Date: 2025-06-02 12:47:53.880933+00:00
6+
7+
"""
8+
9+
import sqlalchemy as sa
10+
from alembic import op
11+
12+
# revision identifiers, used by Alembic.
13+
revision = "73fd9c8b8a1d"
14+
down_revision = "4f6fd2586491"
15+
branch_labels = None
16+
depends_on = None
17+
18+
19+
def upgrade():
20+
# ### commands auto generated by Alembic - please adjust! ###
21+
op.add_column("comp_runs", sa.Column("group_by_flag", sa.String(), nullable=True))
22+
# ### end Alembic commands ###
23+
24+
# Backfill existing rows with "migration" + run_id
25+
op.execute(
26+
"""
27+
UPDATE comp_runs
28+
SET group_by_flag = 'migration' || run_id
29+
WHERE group_by_flag IS NULL
30+
"""
31+
)
32+
33+
# Alter columns to set nullable=FalseAdd commentMore actions
34+
op.alter_column(
35+
"comp_runs",
36+
"group_by_flag",
37+
existing_type=sa.String(),
38+
nullable=False,
39+
)
40+
41+
42+
def downgrade():
43+
# ### commands auto generated by Alembic - please adjust! ###
44+
op.drop_column("comp_runs", "group_by_flag")
45+
# ### end Alembic commands ###

0 commit comments

Comments
 (0)