Midway through disaster of changing table names.

This commit is contained in:
Landon Wark
2024-01-19 15:17:07 -06:00
parent d66d861262
commit 319f72cab2
31 changed files with 1040 additions and 1457 deletions

View File

@@ -1,46 +0,0 @@
"""Adding in processes
Revision ID: 10c47a04559d
Revises: 94289d4e63e6
Create Date: 2024-01-05 13:25:02.468436
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '10c47a04559d'
down_revision = '94289d4e63e6'
branch_labels = None
depends_on = None
def upgrade() -> None:
# ### commands auto generated by Alembic - please adjust! ###
op.create_table('_process',
sa.Column('id', sa.INTEGER(), nullable=False),
sa.Column('name', sa.String(length=64), nullable=True),
sa.PrimaryKeyConstraint('id')
)
op.create_table('_equipmentroles_processes',
sa.Column('process_id', sa.INTEGER(), nullable=True),
sa.Column('equipmentroles_id', sa.INTEGER(), nullable=True),
sa.ForeignKeyConstraint(['equipmentroles_id'], ['_equipment_roles.id'], ),
sa.ForeignKeyConstraint(['process_id'], ['_process.id'], )
)
op.create_table('_submissiontypes_processes',
sa.Column('process_id', sa.INTEGER(), nullable=True),
sa.Column('equipmentroles_id', sa.INTEGER(), nullable=True),
sa.ForeignKeyConstraint(['equipmentroles_id'], ['_submission_types.id'], ),
sa.ForeignKeyConstraint(['process_id'], ['_process.id'], )
)
# ### end Alembic commands ###
def downgrade() -> None:
# ### commands auto generated by Alembic - please adjust! ###
op.drop_table('_submissiontypes_processes')
op.drop_table('_equipmentroles_processes')
op.drop_table('_process')
# ### end Alembic commands ###

View File

@@ -1,44 +0,0 @@
"""SubmissionReagentAssociations added
Revision ID: 238c3c3e5863
Revises: 2684f065037c
Create Date: 2023-12-05 12:57:17.446606
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '238c3c3e5863'
down_revision = '2684f065037c'
branch_labels = None
depends_on = None
def upgrade() -> None:
# ### commands auto generated by Alembic - please adjust! ###
with op.batch_alter_table('_reagents_submissions', schema=None) as batch_op:
batch_op.add_column(sa.Column('comments', sa.String(length=1024), nullable=True))
batch_op.alter_column('reagent_id',
existing_type=sa.INTEGER(),
nullable=False)
batch_op.alter_column('submission_id',
existing_type=sa.INTEGER(),
nullable=False)
# ### end Alembic commands ###
def downgrade() -> None:
# ### commands auto generated by Alembic - please adjust! ###
with op.batch_alter_table('_reagents_submissions', schema=None) as batch_op:
batch_op.alter_column('submission_id',
existing_type=sa.INTEGER(),
nullable=True)
batch_op.alter_column('reagent_id',
existing_type=sa.INTEGER(),
nullable=True)
batch_op.drop_column('comments')
# ### end Alembic commands ###

View File

@@ -1,34 +0,0 @@
"""link controls with Bacterial Culture Samples
Revision ID: 2684f065037c
Revises: 7e7b6eeca468
Create Date: 2023-12-05 10:29:31.126732
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '2684f065037c'
down_revision = '7e7b6eeca468'
branch_labels = None
depends_on = None
def upgrade() -> None:
# ### commands auto generated by Alembic - please adjust! ###
with op.batch_alter_table('_control_samples', schema=None) as batch_op:
batch_op.add_column(sa.Column('sample_id', sa.INTEGER(), nullable=True))
batch_op.create_foreign_key('cont_BCS_id', '_samples', ['sample_id'], ['id'], ondelete='SET NULL')
# ### end Alembic commands ###
def downgrade() -> None:
# ### commands auto generated by Alembic - please adjust! ###
with op.batch_alter_table('_control_samples', schema=None) as batch_op:
batch_op.drop_constraint('cont_BCS_id', type_='foreignkey')
batch_op.drop_column('sample_id')
# ### end Alembic commands ###

View File

@@ -1,40 +0,0 @@
"""Adding role tag to SubmissionEquipmentAssociation
Revision ID: 30aab47d6f12
Revises: bc7a74476609
Create Date: 2023-12-27 09:00:26.262904
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '30aab47d6f12'
down_revision = 'bc7a74476609'
branch_labels = None
depends_on = None
def upgrade() -> None:
# ### commands auto generated by Alembic - please adjust! ###
# op.drop_table('_alembic_tmp__equipment')
with op.batch_alter_table('_equipment_submissions', schema=None) as batch_op:
batch_op.add_column(sa.Column('role', sa.String(length=64), nullable=True))
# ### end Alembic commands ###
def downgrade() -> None:
# ### commands auto generated by Alembic - please adjust! ###
with op.batch_alter_table('_equipment_submissions', schema=None) as batch_op:
batch_op.drop_column('role')
# op.create_table('_alembic_tmp__equipment',
# sa.Column('id', sa.INTEGER(), nullable=False),
# sa.Column('name', sa.VARCHAR(length=64), nullable=True),
# sa.Column('nickname', sa.VARCHAR(length=64), nullable=True),
# sa.Column('asset_number', sa.VARCHAR(length=16), nullable=True),
# sa.PrimaryKeyConstraint('id')
# )
# ### end Alembic commands ###

View File

@@ -1,52 +0,0 @@
"""Adding in Equipment
Revision ID: 36a47d8837ca
Revises: 238c3c3e5863
Create Date: 2023-12-12 09:16:09.559753
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '36a47d8837ca'
down_revision = '238c3c3e5863'
branch_labels = None
depends_on = None
def upgrade() -> None:
# ### commands auto generated by Alembic - please adjust! ###
op.create_table('_equipment',
sa.Column('id', sa.INTEGER(), nullable=False),
sa.Column('name', sa.String(length=64), nullable=True),
sa.Column('nickname', sa.String(length=64), nullable=True),
sa.Column('asset_number', sa.String(length=16), nullable=True),
sa.PrimaryKeyConstraint('id')
)
op.create_table('_submissiontype_equipment',
sa.Column('equipment_id', sa.INTEGER(), nullable=False),
sa.Column('submission_id', sa.INTEGER(), nullable=False),
sa.Column('uses', sa.JSON(), nullable=True),
sa.ForeignKeyConstraint(['equipment_id'], ['_equipment.id'], ),
sa.ForeignKeyConstraint(['submission_id'], ['_submission_types.id'], ),
sa.PrimaryKeyConstraint('equipment_id', 'submission_id')
)
op.create_table('_equipment_submissions',
sa.Column('equipment_id', sa.INTEGER(), nullable=False),
sa.Column('submission_id', sa.INTEGER(), nullable=False),
sa.Column('comments', sa.String(length=1024), nullable=True),
sa.ForeignKeyConstraint(['equipment_id'], ['_equipment.id'], ),
sa.ForeignKeyConstraint(['submission_id'], ['_submissions.id'], ),
sa.PrimaryKeyConstraint('equipment_id', 'submission_id')
)
# ### end Alembic commands ###
def downgrade() -> None:
# ### commands auto generated by Alembic - please adjust! ###
op.drop_table('_equipment_submissions')
op.drop_table('_submissiontype_equipment')
op.drop_table('_equipment')
# ### end Alembic commands ###

View File

@@ -1,34 +0,0 @@
"""Adding times to equipSubAssoc
Revision ID: 3e94fecbbe91
Revises: cd5c225b5d2a
Create Date: 2023-12-15 09:38:33.931976
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '3e94fecbbe91'
down_revision = 'cd5c225b5d2a'
branch_labels = None
depends_on = None
def upgrade() -> None:
# ### commands auto generated by Alembic - please adjust! ###
with op.batch_alter_table('_equipment_submissions', schema=None) as batch_op:
batch_op.add_column(sa.Column('start_time', sa.TIMESTAMP(), nullable=True))
batch_op.add_column(sa.Column('end_time', sa.TIMESTAMP(), nullable=True))
# ### end Alembic commands ###
def downgrade() -> None:
# ### commands auto generated by Alembic - please adjust! ###
with op.batch_alter_table('_equipment_submissions', schema=None) as batch_op:
batch_op.drop_column('end_time')
batch_op.drop_column('start_time')
# ### end Alembic commands ###

View File

@@ -1,34 +0,0 @@
"""Adding SubmissionType to KitReagentTypeAssociations
Revision ID: 4606a7be32e8
Revises: 67fa77849024
Create Date: 2024-01-08 09:04:46.917615
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '4606a7be32e8'
down_revision = '67fa77849024'
branch_labels = None
depends_on = None
def upgrade() -> None:
# ### commands auto generated by Alembic - please adjust! ###
with op.batch_alter_table('_reagenttypes_kittypes', schema=None) as batch_op:
batch_op.add_column(sa.Column('submission_type_id', sa.INTEGER(), nullable=False))
batch_op.create_foreign_key("st_kt_rt_assoc", '_submission_types', ['submission_type_id'], ['id'])
# ### end Alembic commands ###
def downgrade() -> None:
# ### commands auto generated by Alembic - please adjust! ###
with op.batch_alter_table('_reagenttypes_kittypes', schema=None) as batch_op:
batch_op.drop_constraint(None, type_='foreignkey')
batch_op.drop_column('submission_type_id')
# ### end Alembic commands ###

View File

@@ -1,38 +0,0 @@
"""Adjusting process-submissionequipassoc
Revision ID: 67fa77849024
Revises: e08a69a0f381
Create Date: 2024-01-05 15:06:24.305945
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '67fa77849024'
down_revision = 'e08a69a0f381'
branch_labels = None
depends_on = None
def upgrade() -> None:
# ### commands auto generated by Alembic - please adjust! ###
with op.batch_alter_table('_equipment_submissions', schema=None) as batch_op:
batch_op.add_column(sa.Column('process_id', sa.INTEGER(), nullable=True))
# batch_op.drop_constraint(None, type_='foreignkey')
batch_op.create_foreign_key('SEA_Process_id', '_process', ['process_id'], ['id'], ondelete='SET NULL')
batch_op.drop_column('process')
# ### end Alembic commands ###
def downgrade() -> None:
# ### commands auto generated by Alembic - please adjust! ###
with op.batch_alter_table('_equipment_submissions', schema=None) as batch_op:
batch_op.add_column(sa.Column('process', sa.VARCHAR(length=64), nullable=True))
batch_op.drop_constraint('SEA_Process_id', type_='foreignkey')
batch_op.create_foreign_key(None, '_process', ['process'], ['id'], ondelete='SET NULL')
batch_op.drop_column('process_id')
# ### end Alembic commands ###

View File

@@ -1,32 +0,0 @@
"""Adding equipment clustering
Revision ID: 761baf9d7842
Revises: 3e94fecbbe91
Create Date: 2023-12-18 14:31:21.533319
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '761baf9d7842'
down_revision = '3e94fecbbe91'
branch_labels = None
depends_on = None
def upgrade() -> None:
# ### commands auto generated by Alembic - please adjust! ###
with op.batch_alter_table('_equipment', schema=None) as batch_op:
batch_op.add_column(sa.Column('cluster_name', sa.String(length=16), nullable=True))
# ### end Alembic commands ###
def downgrade() -> None:
# ### commands auto generated by Alembic - please adjust! ###
with op.batch_alter_table('_equipment', schema=None) as batch_op:
batch_op.drop_column('cluster_name')
# ### end Alembic commands ###

View File

@@ -1,32 +0,0 @@
"""add templates to submission types
Revision ID: 7e7b6eeca468
Revises:
Create Date: 2023-11-23 08:07:51.103392
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '7e7b6eeca468'
down_revision = None
branch_labels = None
depends_on = None
def upgrade() -> None:
# ### commands auto generated by Alembic - please adjust! ###
with op.batch_alter_table('_submission_types', schema=None) as batch_op:
batch_op.add_column(sa.Column('template_file', sa.BLOB(), nullable=True))
# ### end Alembic commands ###
def downgrade() -> None:
# ### commands auto generated by Alembic - please adjust! ###
with op.batch_alter_table('_submission_types', schema=None) as batch_op:
batch_op.drop_column('template_file')
# ### end Alembic commands ###

View File

@@ -1,36 +0,0 @@
"""Updating primary key for SubmissionEquipmentAssociation
Revision ID: 94289d4e63e6
Revises: 30aab47d6f12
Create Date: 2024-01-03 15:14:21.156127
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '94289d4e63e6'
down_revision = '30aab47d6f12'
branch_labels = None
depends_on = None
def upgrade() -> None:
# ### commands auto generated by Alembic - please adjust! ###
with op.batch_alter_table('_equipment_submissions', schema=None) as batch_op:
batch_op.alter_column('role',
existing_type=sa.VARCHAR(length=64),
nullable=False)
# ### end Alembic commands ###
def downgrade() -> None:
# ### commands auto generated by Alembic - please adjust! ###
with op.batch_alter_table('_equipment_submissions', schema=None) as batch_op:
batch_op.alter_column('role',
existing_type=sa.VARCHAR(length=64),
nullable=True)
# ### end Alembic commands ###

View File

@@ -1,59 +0,0 @@
"""Adding equipment roles
Revision ID: bc7a74476609
Revises: 761baf9d7842
Create Date: 2023-12-21 10:44:23.520392
"""
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import sqlite
# revision identifiers, used by Alembic.
revision = 'bc7a74476609'
down_revision = '761baf9d7842'
branch_labels = None
depends_on = None
def upgrade() -> None:
# ### commands auto generated by Alembic - please adjust! ###
op.create_table('_equipment_roles',
sa.Column('id', sa.INTEGER(), nullable=False),
sa.Column('name', sa.String(length=32), nullable=True),
sa.PrimaryKeyConstraint('id')
)
op.create_table('_equipmentroles_equipment',
sa.Column('equipment_id', sa.INTEGER(), nullable=True),
sa.Column('equipmentroles_id', sa.INTEGER(), nullable=True),
sa.ForeignKeyConstraint(['equipment_id'], ['_equipment.id'], ),
sa.ForeignKeyConstraint(['equipmentroles_id'], ['_equipment_roles.id'], )
)
op.create_table('_submissiontype_equipmentrole',
sa.Column('equipmentrole_id', sa.INTEGER(), nullable=False),
sa.Column('submissiontype_id', sa.INTEGER(), nullable=False),
sa.Column('uses', sa.JSON(), nullable=True),
sa.Column('static', sa.INTEGER(), nullable=True),
sa.ForeignKeyConstraint(['equipmentrole_id'], ['_equipment_roles.id'], ),
sa.ForeignKeyConstraint(['submissiontype_id'], ['_submission_types.id'], ),
sa.PrimaryKeyConstraint('equipmentrole_id', 'submissiontype_id')
)
op.drop_table('_submissiontype_equipment')
# ### end Alembic commands ###
def downgrade() -> None:
# ### commands auto generated by Alembic - please adjust! ###
op.create_table('_submissiontype_equipment',
sa.Column('equipment_id', sa.INTEGER(), nullable=False),
sa.Column('submissiontype_id', sa.INTEGER(), nullable=False),
sa.Column('uses', sqlite.JSON(), nullable=True),
sa.Column('static', sa.INTEGER(), nullable=True),
sa.ForeignKeyConstraint(['equipment_id'], ['_equipment.id'], ),
sa.ForeignKeyConstraint(['submissiontype_id'], ['_submission_types.id'], ),
sa.PrimaryKeyConstraint('equipment_id', 'submissiontype_id')
)
op.drop_table('_submissiontype_equipmentrole')
op.drop_table('_equipmentroles_equipment')
op.drop_table('_equipment_roles')
# ### end Alembic commands ###

View File

@@ -1,32 +0,0 @@
"""Adding static option to equipSTASsoc
Revision ID: cd11db3794ed
Revises: 36a47d8837ca
Create Date: 2023-12-12 14:47:20.924443
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = 'cd11db3794ed'
down_revision = '36a47d8837ca'
branch_labels = None
depends_on = None
def upgrade() -> None:
# ### commands auto generated by Alembic - please adjust! ###
with op.batch_alter_table('_submissiontype_equipment', schema=None) as batch_op:
batch_op.add_column(sa.Column('static', sa.INTEGER(), nullable=True))
# ### end Alembic commands ###
def downgrade() -> None:
# ### commands auto generated by Alembic - please adjust! ###
with op.batch_alter_table('_submissiontype_equipment', schema=None) as batch_op:
batch_op.drop_column('static')
# ### end Alembic commands ###

View File

@@ -1,32 +0,0 @@
"""Adding process to equipSubAssoc
Revision ID: cd5c225b5d2a
Revises: cd11db3794ed
Create Date: 2023-12-15 09:13:23.492512
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = 'cd5c225b5d2a'
down_revision = 'cd11db3794ed'
branch_labels = None
depends_on = None
def upgrade() -> None:
# ### commands auto generated by Alembic - please adjust! ###
with op.batch_alter_table('_equipment_submissions', schema=None) as batch_op:
batch_op.add_column(sa.Column('process', sa.String(length=64), nullable=True))
# ### end Alembic commands ###
def downgrade() -> None:
# ### commands auto generated by Alembic - please adjust! ###
with op.batch_alter_table('_equipment_submissions', schema=None) as batch_op:
batch_op.drop_column('process')
# ### end Alembic commands ###

View File

@@ -1,32 +0,0 @@
"""Attaching Process to SubmissionEquipmentAssociation
Revision ID: e08a69a0f381
Revises: 10c47a04559d
Create Date: 2024-01-05 14:50:55.681167
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = 'e08a69a0f381'
down_revision = '10c47a04559d'
branch_labels = None
depends_on = None
def upgrade() -> None:
# ### commands auto generated by Alembic - please adjust! ###
with op.batch_alter_table('_equipment_submissions', schema=None) as batch_op:
batch_op.create_foreign_key('SEA_Process_id', '_process', ['process'], ['id'], ondelete='SET NULL')
# ### end Alembic commands ###
def downgrade() -> None:
# ### commands auto generated by Alembic - please adjust! ###
with op.batch_alter_table('_equipment_submissions', schema=None) as batch_op:
batch_op.drop_constraint('SEA_Process_id', type_='foreignkey')
# ### end Alembic commands ###