52 lines
1.7 KiB
Python
52 lines
1.7 KiB
Python
"""empty message
|
|
|
|
Revision ID: dadf16305482
|
|
Revises: cc4bccc5e5a8
|
|
Create Date: 2020-05-23 20:43:43.882267
|
|
|
|
"""
|
|
from alembic import op
|
|
import sqlalchemy as sa
|
|
|
|
|
|
# revision identifiers, used by Alembic.
|
|
revision = 'dadf16305482'
|
|
down_revision = 'cc4bccc5e5a8'
|
|
branch_labels = None
|
|
depends_on = None
|
|
|
|
|
|
def upgrade():
|
|
# ### commands auto generated by Alembic - please adjust! ###
|
|
op.create_table('approval',
|
|
sa.Column('id', sa.Integer(), nullable=False),
|
|
sa.Column('study_id', sa.Integer(), nullable=False),
|
|
sa.Column('workflow_id', sa.Integer(), nullable=False),
|
|
sa.Column('approver_uid', sa.String(), nullable=True),
|
|
sa.Column('status', sa.String(), nullable=True),
|
|
sa.Column('message', sa.String(), nullable=True),
|
|
sa.Column('date_created', sa.DateTime(timezone=True), nullable=True),
|
|
sa.Column('version', sa.Integer(), nullable=True),
|
|
sa.Column('workflow_hash', sa.String(), nullable=True),
|
|
sa.ForeignKeyConstraint(['study_id'], ['study.id'], ),
|
|
sa.ForeignKeyConstraint(['workflow_id'], ['workflow.id'], ),
|
|
sa.PrimaryKeyConstraint('id')
|
|
)
|
|
op.create_table('approval_file',
|
|
sa.Column('id', sa.Integer(), nullable=False),
|
|
sa.Column('file_id', sa.Integer(), nullable=False),
|
|
sa.Column('approval_id', sa.Integer(), nullable=False),
|
|
sa.Column('file_version', sa.Integer(), nullable=False),
|
|
sa.ForeignKeyConstraint(['approval_id'], ['approval.id'], ),
|
|
sa.ForeignKeyConstraint(['file_id'], ['file.id'], ),
|
|
sa.PrimaryKeyConstraint('id')
|
|
)
|
|
# ### end Alembic commands ###
|
|
|
|
|
|
def downgrade():
|
|
# ### commands auto generated by Alembic - please adjust! ###
|
|
op.drop_table('approval_file')
|
|
op.drop_table('approval')
|
|
# ### end Alembic commands ###
|