Skip to content

Commit a5a7af9

Browse files
authored
feat: Add alembic migration for summary field of acmg rank model (#820)
1 parent d88d283 commit a5a7af9

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
"""Add summary column to acmg_rating table
2+
3+
Revision ID: 11bc8e4ebc4d
4+
Revises: 6f14afa8ea47
5+
Create Date: 2024-09-25 13:33:43.805887+02:00
6+
7+
"""
8+
9+
import fastapi_users_db_sqlalchemy.generics # noqa
10+
import sqlalchemy as sa
11+
from sqlalchemy.dialects import postgresql
12+
13+
from alembic import op
14+
15+
# revision identifiers, used by Alembic.
16+
revision = "11bc8e4ebc4d"
17+
down_revision = "6f14afa8ea47"
18+
branch_labels = None
19+
depends_on = None
20+
21+
22+
def upgrade():
23+
# ### commands auto generated by Alembic - please adjust! ###
24+
op.add_column("acmgseqvar", sa.Column("summary", sa.String(), nullable=True))
25+
26+
# Update existing records to have an empty summary
27+
op.execute("UPDATE acmgseqvar SET summary = ''")
28+
# ### end Alembic commands ###
29+
30+
31+
def downgrade():
32+
# ### commands auto generated by Alembic - please adjust! ###
33+
# Remove the summary column
34+
op.drop_column("acmgseqvar", "summary")
35+
# ### end Alembic commands ###

0 commit comments

Comments
 (0)