<reponame>dandud/dabl<filename>migrations/versions/8381558836c1_container_history_table_creation.py
"""container history table creation

Revision ID: 8381558836c1
Revises: <PASSWORD>
Create Date: 2021-11-02 21:10:46.890703

"""
from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = '8381558836c1'
down_revision = '<PASSWORD>'
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table('container_history',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('user_id', sa.Integer(), nullable=True),
    sa.Column('modified_on', sa.DateTime(), nullable=True),
    sa.Column('container_id', sa.Integer(), nullable=True),
    sa.Column('location_id', sa.Integer(), nullable=True),
    sa.Column('containertype_id', sa.Integer(), nullable=True),
    sa.Column('status_id', sa.Integer(), nullable=True),
    sa.ForeignKeyConstraint(['container_id'], ['containers.id'], ),
    sa.ForeignKeyConstraint(['containertype_id'], ['containertypes.id'], ),
    sa.ForeignKeyConstraint(['location_id'], ['locations.id'], ),
    sa.ForeignKeyConstraint(['status_id'], ['statuses.id'], ),
    sa.ForeignKeyConstraint(['user_id'], ['users.id'], ),
    sa.PrimaryKeyConstraint('id')
    )
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_table('container_history')
    # ### end Alembic commands ###

"""container history table creation

Revision ID: 8381558836c1
Revises: <PASSWORD>
Create Date: 2021-11-02 21:10:46.890703

"""
from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = '8381558836c1'
down_revision = '<PASSWORD>'
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table('container_history',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('user_id', sa.Integer(), nullable=True),
    sa.Column('modified_on', sa.DateTime(), nullable=True),
    sa.Column('container_id', sa.Integer(), nullable=True),
    sa.Column('location_id', sa.Integer(), nullable=True),
    sa.Column('containertype_id', sa.Integer(), nullable=True),
    sa.Column('status_id', sa.Integer(), nullable=True),
    sa.ForeignKeyConstraint(['container_id'], ['containers.id'], ),
    sa.ForeignKeyConstraint(['containertype_id'], ['containertypes.id'], ),
    sa.ForeignKeyConstraint(['location_id'], ['locations.id'], ),
    sa.ForeignKeyConstraint(['status_id'], ['statuses.id'], ),
    sa.ForeignKeyConstraint(['user_id'], ['users.id'], ),
    sa.PrimaryKeyConstraint('id')
    )
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_table('container_history')
    # ### end Alembic commands ###
container history table creation  Revision ID: 8381558836c1 Revises: <PASSWORD> Create Date: 2021-11-02 21:10:46.890703 # revision identifiers, used by Alembic. # ### commands auto generated by Alembic - please adjust! ### # ### end Alembic commands ### # ### commands auto generated by Alembic - please adjust! ### # ### end Alembic commands ###