Adding Migration, and checking that everything till works the same as before, only a little better.

This commit is contained in:
Dan Funk 2020-04-22 15:45:58 -04:00
parent 6de8c8b977
commit c140637dde
1 changed files with 45 additions and 0 deletions

View File

@ -0,0 +1,45 @@
"""empty message
Revision ID: 1685be1cc232
Revises: 0f38d7a36f21
Create Date: 2020-04-22 15:37:12.577008
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '1685be1cc232'
down_revision = '0f38d7a36f21'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.create_table('lookup_file',
sa.Column('id', sa.Integer(), nullable=False),
sa.Column('label_column', sa.String(), nullable=True),
sa.Column('value_column', sa.String(), nullable=True),
sa.Column('file_data_model_id', sa.Integer(), nullable=True),
sa.ForeignKeyConstraint(['file_data_model_id'], ['file_data.id'], ),
sa.PrimaryKeyConstraint('id')
)
op.create_table('lookup_data',
sa.Column('id', sa.Integer(), nullable=False),
sa.Column('lookup_file_model_id', sa.Integer(), nullable=True),
sa.Column('value', sa.String(), nullable=True),
sa.Column('label', sa.String(), nullable=True),
sa.Column('data', sa.JSON(), nullable=True),
sa.ForeignKeyConstraint(['lookup_file_model_id'], ['lookup_file.id'], ),
sa.PrimaryKeyConstraint('id')
)
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_table('lookup_data')
op.drop_table('lookup_file')
# ### end Alembic commands ###