-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Add alembic migration for summary field of acmg rank model (#820)
- Loading branch information
Showing
1 changed file
with
35 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 ### |