prior to db rebuild

This commit is contained in:
Landon Wark
2023-07-26 14:05:52 -05:00
parent 82dffe3af2
commit f22e697815
11 changed files with 76 additions and 53 deletions

View 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 ###