57 lines
2.2 KiB
Python
57 lines
2.2 KiB
Python
"""polymorpherizing associations
|
|
|
|
Revision ID: da94eca9d381
|
|
Revises: b879020f2a91
|
|
Create Date: 2023-08-03 13:30:34.056316
|
|
|
|
"""
|
|
from alembic import op
|
|
import sqlalchemy as sa
|
|
from sqlalchemy.dialects import sqlite
|
|
|
|
# revision identifiers, used by Alembic.
|
|
revision = 'da94eca9d381'
|
|
down_revision = 'b879020f2a91'
|
|
branch_labels = None
|
|
depends_on = None
|
|
|
|
|
|
def upgrade() -> None:
|
|
# ### commands auto generated by Alembic - please adjust! ###
|
|
with op.batch_alter_table('_samples', schema=None) as batch_op:
|
|
batch_op.drop_column('ct_n2')
|
|
batch_op.drop_column('n1_status')
|
|
batch_op.drop_column('pcr_results')
|
|
batch_op.drop_column('n2_status')
|
|
batch_op.drop_column('ct_n1')
|
|
|
|
with op.batch_alter_table('_submission_sample', schema=None) as batch_op:
|
|
batch_op.add_column(sa.Column('base_sub_type', sa.String(), nullable=True))
|
|
batch_op.add_column(sa.Column('ct_n1', sa.FLOAT(precision=2), nullable=True))
|
|
batch_op.add_column(sa.Column('ct_n2', sa.FLOAT(precision=2), nullable=True))
|
|
batch_op.add_column(sa.Column('n1_status', sa.String(length=32), nullable=True))
|
|
batch_op.add_column(sa.Column('n2_status', sa.String(length=32), nullable=True))
|
|
batch_op.add_column(sa.Column('pcr_results', sa.JSON(), nullable=True))
|
|
|
|
# ### end Alembic commands ###
|
|
|
|
|
|
def downgrade() -> None:
|
|
# ### commands auto generated by Alembic - please adjust! ###
|
|
with op.batch_alter_table('_submission_sample', schema=None) as batch_op:
|
|
batch_op.drop_column('pcr_results')
|
|
batch_op.drop_column('n2_status')
|
|
batch_op.drop_column('n1_status')
|
|
batch_op.drop_column('ct_n2')
|
|
batch_op.drop_column('ct_n1')
|
|
batch_op.drop_column('base_sub_type')
|
|
|
|
with op.batch_alter_table('_samples', schema=None) as batch_op:
|
|
batch_op.add_column(sa.Column('ct_n1', sa.FLOAT(), nullable=True))
|
|
batch_op.add_column(sa.Column('n2_status', sa.VARCHAR(length=32), nullable=True))
|
|
batch_op.add_column(sa.Column('pcr_results', sqlite.JSON(), nullable=True))
|
|
batch_op.add_column(sa.Column('n1_status', sa.VARCHAR(length=32), nullable=True))
|
|
batch_op.add_column(sa.Column('ct_n2', sa.FLOAT(), nullable=True))
|
|
|
|
# ### end Alembic commands ###
|