nopaque/migrations/versions/b15366b25bea_.py

43 lines
1.2 KiB
Python
Raw Normal View History

"""empty message
Revision ID: b15366b25bea
Revises: 4886241e0f5d
Create Date: 2020-06-29 13:41:14.394680
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = 'b15366b25bea'
down_revision = '4886241e0f5d'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.create_table('results',
sa.Column('id', sa.Integer(), nullable=False),
sa.Column('user_id', sa.Integer(), nullable=True),
sa.ForeignKeyConstraint(['user_id'], ['users.id'], ),
sa.PrimaryKeyConstraint('id')
)
op.create_table('result_files',
sa.Column('id', sa.Integer(), nullable=False),
sa.Column('result_id', sa.Integer(), nullable=True),
sa.Column('filename', sa.String(length=255), nullable=True),
sa.Column('dir', sa.String(length=255), nullable=True),
sa.ForeignKeyConstraint(['result_id'], ['results.id'], ),
sa.PrimaryKeyConstraint('id')
)
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_table('result_files')
op.drop_table('results')
# ### end Alembic commands ###