Skip to content

Commit

Permalink
feat: Add alembic migration for summary field of acmg rank model (#820)
Browse files Browse the repository at this point in the history
  • Loading branch information
gromdimon authored Sep 25, 2024
1 parent d88d283 commit a5a7af9
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions backend/alembic/versions/11bc8e4ebc4d_add_acmg_summary.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
"""Add summary column to acmg_rating table
Revision ID: 11bc8e4ebc4d
Revises: 6f14afa8ea47
Create Date: 2024-09-25 13:33:43.805887+02:00
"""

import fastapi_users_db_sqlalchemy.generics # noqa
import sqlalchemy as sa
from sqlalchemy.dialects import postgresql

from alembic import op

# revision identifiers, used by Alembic.
revision = "11bc8e4ebc4d"
down_revision = "6f14afa8ea47"
branch_labels = None
depends_on = None


def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.add_column("acmgseqvar", sa.Column("summary", sa.String(), nullable=True))

# Update existing records to have an empty summary
op.execute("UPDATE acmgseqvar SET summary = ''")
# ### end Alembic commands ###


def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
# Remove the summary column
op.drop_column("acmgseqvar", "summary")
# ### end Alembic commands ###

0 comments on commit a5a7af9

Please sign in to comment.