list medical card base
This commit is contained in:
70
alembic/versions/8282d5b2badc_initial.py
Normal file
70
alembic/versions/8282d5b2badc_initial.py
Normal file
@@ -0,0 +1,70 @@
|
||||
"""initial
|
||||
|
||||
Revision ID: 8282d5b2badc
|
||||
Revises:
|
||||
Create Date: 2023-07-21 22:53:46.768440
|
||||
|
||||
"""
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
from sqlalchemy.dialects import postgresql
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = '8282d5b2badc'
|
||||
down_revision = None
|
||||
branch_labels = None
|
||||
depends_on = None
|
||||
|
||||
|
||||
def upgrade() -> None:
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.create_table('medical_cards',
|
||||
sa.Column('number', sa.String(length=100), nullable=False),
|
||||
sa.Column('confidant_persons', postgresql.ARRAY(sa.UUID()), nullable=True),
|
||||
sa.Column('id', sa.UUID(), nullable=False),
|
||||
sa.Column('created_at', sa.TIMESTAMP(), nullable=False),
|
||||
sa.Column('updated_at', sa.TIMESTAMP(), nullable=False),
|
||||
sa.PrimaryKeyConstraint('id')
|
||||
)
|
||||
op.create_index(op.f('ix_medical_cards_id'), 'medical_cards', ['id'], unique=False)
|
||||
op.create_table('checkups',
|
||||
sa.Column('medical_card_id', sa.UUID(), nullable=False),
|
||||
sa.Column('medic_id', sa.UUID(), nullable=True),
|
||||
sa.Column('claims', postgresql.ARRAY(sa.String()), nullable=True),
|
||||
sa.Column('allergies', postgresql.ARRAY(sa.String()), nullable=True),
|
||||
sa.Column('diseases', postgresql.ARRAY(sa.String()), nullable=True),
|
||||
sa.Column('medicines', postgresql.ARRAY(sa.String()), nullable=True),
|
||||
sa.Column('disease_process', sa.Text(), nullable=True),
|
||||
sa.Column('visual_inspection', postgresql.ARRAY(sa.String()), nullable=True),
|
||||
sa.Column('dental_formula', postgresql.JSONB(astext_type=sa.Text()), nullable=True),
|
||||
sa.Column('dental_formula_ext', postgresql.JSONB(astext_type=sa.Text()), nullable=True),
|
||||
sa.Column('id', sa.UUID(), nullable=False),
|
||||
sa.Column('created_at', sa.TIMESTAMP(), nullable=False),
|
||||
sa.Column('updated_at', sa.TIMESTAMP(), nullable=False),
|
||||
sa.ForeignKeyConstraint(['medical_card_id'], ['medical_cards.id'], ),
|
||||
sa.PrimaryKeyConstraint('id')
|
||||
)
|
||||
op.create_index(op.f('ix_checkups_id'), 'checkups', ['id'], unique=False)
|
||||
op.create_table('health_maps',
|
||||
sa.Column('comment', sa.Text(), nullable=True),
|
||||
sa.Column('attachments', postgresql.ARRAY(sa.String()), nullable=True),
|
||||
sa.Column('medical_card_id', sa.UUID(), nullable=False),
|
||||
sa.Column('id', sa.UUID(), nullable=False),
|
||||
sa.Column('created_at', sa.TIMESTAMP(), nullable=False),
|
||||
sa.Column('updated_at', sa.TIMESTAMP(), nullable=False),
|
||||
sa.ForeignKeyConstraint(['medical_card_id'], ['medical_cards.id'], ),
|
||||
sa.PrimaryKeyConstraint('id')
|
||||
)
|
||||
op.create_index(op.f('ix_health_maps_id'), 'health_maps', ['id'], unique=False)
|
||||
# ### end Alembic commands ###
|
||||
|
||||
|
||||
def downgrade() -> None:
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.drop_index(op.f('ix_health_maps_id'), table_name='health_maps')
|
||||
op.drop_table('health_maps')
|
||||
op.drop_index(op.f('ix_checkups_id'), table_name='checkups')
|
||||
op.drop_table('checkups')
|
||||
op.drop_index(op.f('ix_medical_cards_id'), table_name='medical_cards')
|
||||
op.drop_table('medical_cards')
|
||||
# ### end Alembic commands ###
|
||||
28
alembic/versions/aa4d531271c0_add_person_id.py
Normal file
28
alembic/versions/aa4d531271c0_add_person_id.py
Normal file
@@ -0,0 +1,28 @@
|
||||
"""add person_id
|
||||
|
||||
Revision ID: aa4d531271c0
|
||||
Revises: 8282d5b2badc
|
||||
Create Date: 2023-07-22 00:58:19.689019
|
||||
|
||||
"""
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = 'aa4d531271c0'
|
||||
down_revision = '8282d5b2badc'
|
||||
branch_labels = None
|
||||
depends_on = None
|
||||
|
||||
|
||||
def upgrade() -> None:
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.add_column('medical_cards', sa.Column('person_id', sa.UUID(), nullable=False))
|
||||
# ### end Alembic commands ###
|
||||
|
||||
|
||||
def downgrade() -> None:
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.drop_column('medical_cards', 'person_id')
|
||||
# ### end Alembic commands ###
|
||||
Reference in New Issue
Block a user