prior to db rebuild
This commit is contained in:
38
alembic/versions/78178df0286a_making_sample_ids_unique.py
Normal file
38
alembic/versions/78178df0286a_making_sample_ids_unique.py
Normal file
@@ -0,0 +1,38 @@
|
||||
"""making sample ids unique
|
||||
|
||||
Revision ID: 78178df0286a
|
||||
Revises: 4c6221f01324
|
||||
Create Date: 2023-07-26 13:55:41.864399
|
||||
|
||||
"""
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = '78178df0286a'
|
||||
down_revision = '4c6221f01324'
|
||||
branch_labels = None
|
||||
depends_on = None
|
||||
|
||||
|
||||
def upgrade() -> None:
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
with op.batch_alter_table('_bc_samples', schema=None) as batch_op:
|
||||
batch_op.create_unique_constraint("unique_bc_sample", ['sample_id'])
|
||||
|
||||
with op.batch_alter_table('_ww_samples', schema=None) as batch_op:
|
||||
batch_op.create_unique_constraint("unique_ww_sample", ['ww_sample_full_id'])
|
||||
|
||||
# ### end Alembic commands ###
|
||||
|
||||
|
||||
def downgrade() -> None:
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
with op.batch_alter_table('_ww_samples', schema=None) as batch_op:
|
||||
batch_op.drop_constraint(None, type_='unique')
|
||||
|
||||
with op.batch_alter_table('_bc_samples', schema=None) as batch_op:
|
||||
batch_op.drop_constraint(None, type_='unique')
|
||||
|
||||
# ### end Alembic commands ###
|
||||
Reference in New Issue
Block a user