Improved form regeneration for artic.

This commit is contained in:
Landon Wark
2024-01-04 13:29:18 -06:00
parent c688aa160c
commit 19448cc8f3
18 changed files with 519 additions and 123 deletions

View File

@@ -0,0 +1,40 @@
"""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

@@ -0,0 +1,36 @@
"""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

@@ -0,0 +1,59 @@
"""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 ###