Adding in viral culture submissions.
This commit is contained in:
56
alembic/versions/ef1a0222b882_adding_viral_cultures.py
Normal file
56
alembic/versions/ef1a0222b882_adding_viral_cultures.py
Normal file
@@ -0,0 +1,56 @@
|
|||||||
|
"""Adding Viral Cultures
|
||||||
|
|
||||||
|
Revision ID: ef1a0222b882
|
||||||
|
Revises: 0746f7e2c10e
|
||||||
|
Create Date: 2024-09-04 10:23:39.245013
|
||||||
|
|
||||||
|
"""
|
||||||
|
from alembic import op
|
||||||
|
import sqlalchemy as sa
|
||||||
|
|
||||||
|
|
||||||
|
# revision identifiers, used by Alembic.
|
||||||
|
revision = 'ef1a0222b882'
|
||||||
|
down_revision = '0746f7e2c10e'
|
||||||
|
branch_labels = None
|
||||||
|
depends_on = None
|
||||||
|
|
||||||
|
|
||||||
|
def upgrade() -> None:
|
||||||
|
# ### commands auto generated by Alembic - please adjust! ###
|
||||||
|
op.create_table('_viralculture',
|
||||||
|
sa.Column('id', sa.INTEGER(), nullable=False),
|
||||||
|
sa.ForeignKeyConstraint(['id'], ['_basicsubmission.id'], ),
|
||||||
|
sa.PrimaryKeyConstraint('id')
|
||||||
|
)
|
||||||
|
# with op.batch_alter_table('_process', schema=None) as batch_op:
|
||||||
|
# batch_op.create_unique_constraint("process_uni", ['name'])
|
||||||
|
#
|
||||||
|
# with op.batch_alter_table('_submissionsampleassociation', schema=None) as batch_op:
|
||||||
|
# batch_op.create_unique_constraint("subsamp_uni", ['id'])
|
||||||
|
|
||||||
|
# with op.batch_alter_table('_wastewaterarticassociation', schema=None) as batch_op:
|
||||||
|
# batch_op.alter_column('source_plate',
|
||||||
|
# existing_type=sa.VARCHAR(length=16),
|
||||||
|
# type_=sa.String(length=32),
|
||||||
|
# existing_nullable=True)
|
||||||
|
|
||||||
|
# ### end Alembic commands ###
|
||||||
|
|
||||||
|
|
||||||
|
def downgrade() -> None:
|
||||||
|
# ### commands auto generated by Alembic - please adjust! ###
|
||||||
|
with op.batch_alter_table('_wastewaterarticassociation', schema=None) as batch_op:
|
||||||
|
batch_op.alter_column('source_plate',
|
||||||
|
existing_type=sa.String(length=32),
|
||||||
|
type_=sa.VARCHAR(length=16),
|
||||||
|
existing_nullable=True)
|
||||||
|
|
||||||
|
with op.batch_alter_table('_submissionsampleassociation', schema=None) as batch_op:
|
||||||
|
batch_op.drop_constraint("subsamp_uni", type_='unique')
|
||||||
|
|
||||||
|
with op.batch_alter_table('_process', schema=None) as batch_op:
|
||||||
|
batch_op.drop_constraint("process_uni", type_='unique')
|
||||||
|
|
||||||
|
op.drop_table('_viralculture')
|
||||||
|
# ### end Alembic commands ###
|
||||||
Reference in New Issue
Block a user