Improvements to JSON updaters.
This commit is contained in:
@@ -0,0 +1,51 @@
|
||||
"""adding source plates to Artic submission...again
|
||||
|
||||
Revision ID: f18487b41f45
|
||||
Revises: fabf697c721d
|
||||
Create Date: 2024-04-17 10:42:30.508213
|
||||
|
||||
"""
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = 'f18487b41f45'
|
||||
down_revision = 'fabf697c721d'
|
||||
branch_labels = None
|
||||
depends_on = None
|
||||
|
||||
|
||||
def upgrade() -> None:
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
# op.drop_table('_alembic_tmp__submissionsampleassociation')
|
||||
# with op.batch_alter_table('_submissionsampleassociation', schema=None) as batch_op:
|
||||
# batch_op.create_unique_constraint("ssa_id", ['id'])
|
||||
|
||||
with op.batch_alter_table('_wastewaterartic', schema=None) as batch_op:
|
||||
batch_op.add_column(sa.Column('source_plates', sa.JSON(), nullable=True))
|
||||
|
||||
# ### end Alembic commands ###
|
||||
|
||||
|
||||
def downgrade() -> None:
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
with op.batch_alter_table('_wastewaterartic', schema=None) as batch_op:
|
||||
batch_op.drop_column('source_plates')
|
||||
|
||||
# with op.batch_alter_table('_submissionsampleassociation', schema=None) as batch_op:
|
||||
# batch_op.drop_constraint(None, type_='unique')
|
||||
|
||||
# op.create_table('_alembic_tmp__submissionsampleassociation',
|
||||
# sa.Column('sample_id', sa.INTEGER(), nullable=False),
|
||||
# sa.Column('submission_id', sa.INTEGER(), nullable=False),
|
||||
# sa.Column('row', sa.INTEGER(), nullable=False),
|
||||
# sa.Column('column', sa.INTEGER(), nullable=False),
|
||||
# sa.Column('base_sub_type', sa.VARCHAR(), nullable=True),
|
||||
# sa.Column('id', sa.INTEGER(), server_default=sa.text('1'), nullable=False),
|
||||
# sa.ForeignKeyConstraint(['sample_id'], ['_basicsample.id'], ),
|
||||
# sa.ForeignKeyConstraint(['submission_id'], ['_basicsubmission.id'], ),
|
||||
# sa.PrimaryKeyConstraint('submission_id', 'row', 'column'),
|
||||
# sa.UniqueConstraint('id', name='ssa_unique')
|
||||
# )
|
||||
# ### end Alembic commands ###
|
||||
Reference in New Issue
Block a user