Addition of Equipment and SubmissionType creation.
This commit is contained in:
52
alembic/versions/36a47d8837ca_adding_in_equipment.py
Normal file
52
alembic/versions/36a47d8837ca_adding_in_equipment.py
Normal file
@@ -0,0 +1,52 @@
|
||||
"""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 ###
|
||||
@@ -0,0 +1,34 @@
|
||||
"""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 ###
|
||||
32
alembic/versions/761baf9d7842_adding_equipment_clustering.py
Normal file
32
alembic/versions/761baf9d7842_adding_equipment_clustering.py
Normal file
@@ -0,0 +1,32 @@
|
||||
"""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 ###
|
||||
@@ -0,0 +1,32 @@
|
||||
"""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 ###
|
||||
@@ -0,0 +1,32 @@
|
||||
"""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 ###
|
||||
Reference in New Issue
Block a user