mirror of
https://github.com/beak-insights/felicity-lims.git
synced 2025-02-23 08:23:00 +08:00
52 lines
2.1 KiB
Python
52 lines
2.1 KiB
Python
"""added referrence lab
|
|
|
|
Revision ID: 076171c1de19
|
|
Revises: 27611e47eb3d
|
|
Create Date: 2023-05-18 07:38:48.754172
|
|
|
|
"""
|
|
from alembic import op
|
|
import sqlalchemy as sa
|
|
|
|
|
|
# revision identifiers, used by Alembic.
|
|
revision = '076171c1de19'
|
|
down_revision = '27611e47eb3d'
|
|
branch_labels = None
|
|
depends_on = None
|
|
|
|
|
|
def upgrade():
|
|
# ### commands auto generated by Alembic - please adjust! ###
|
|
op.create_table('referrallaboratory',
|
|
sa.Column('name', sa.String(), nullable=True),
|
|
sa.Column('code', sa.String(), nullable=False),
|
|
sa.Column('url', sa.String(), nullable=False),
|
|
sa.Column('username', sa.String(), nullable=False),
|
|
sa.Column('password', sa.String(), nullable=False),
|
|
sa.Column('is_reference', sa.Boolean(), nullable=True),
|
|
sa.Column('is_referral', sa.Boolean(), nullable=True),
|
|
sa.Column('uid', sa.String(), nullable=False),
|
|
sa.Column('created_at', sa.DateTime(), nullable=True),
|
|
sa.Column('created_by_uid', sa.String(), nullable=True),
|
|
sa.Column('updated_at', sa.DateTime(), nullable=True),
|
|
sa.Column('updated_by_uid', sa.String(), nullable=True),
|
|
sa.ForeignKeyConstraint(['created_by_uid'], ['user.uid'], ),
|
|
sa.ForeignKeyConstraint(['updated_by_uid'], ['user.uid'], ),
|
|
sa.PrimaryKeyConstraint('uid')
|
|
)
|
|
op.create_index(op.f('ix_referrallaboratory_code'), 'referrallaboratory', ['code'], unique=True)
|
|
op.create_index(op.f('ix_referrallaboratory_uid'), 'referrallaboratory', ['uid'], unique=False)
|
|
op.add_column('shipment', sa.Column('laboratory_uid', sa.String(), nullable=True))
|
|
op.create_foreign_key(None, 'shipment', 'referrallaboratory', ['laboratory_uid'], ['uid'])
|
|
# ### end Alembic commands ###
|
|
|
|
|
|
def downgrade():
|
|
# ### commands auto generated by Alembic - please adjust! ###
|
|
op.drop_constraint(None, 'shipment', type_='foreignkey')
|
|
op.drop_column('shipment', 'laboratory_uid')
|
|
op.drop_index(op.f('ix_referrallaboratory_uid'), table_name='referrallaboratory')
|
|
op.drop_index(op.f('ix_referrallaboratory_code'), table_name='referrallaboratory')
|
|
op.drop_table('referrallaboratory')
|
|
# ### end Alembic commands ###
|