29 lines
717 B
Python
29 lines
717 B
Python
"""add medical card unique constaint
|
|
|
|
Revision ID: 9bac2789f1a8
|
|
Revises: 7f86841687c3
|
|
Create Date: 2023-07-22 02:00:26.177149
|
|
|
|
"""
|
|
from alembic import op
|
|
import sqlalchemy as sa
|
|
|
|
|
|
# revision identifiers, used by Alembic.
|
|
revision = '9bac2789f1a8'
|
|
down_revision = '7f86841687c3'
|
|
branch_labels = None
|
|
depends_on = None
|
|
|
|
|
|
def upgrade() -> None:
|
|
# ### commands auto generated by Alembic - please adjust! ###
|
|
op.create_unique_constraint('person_id', 'medical_cards', ['person_id'])
|
|
# ### end Alembic commands ###
|
|
|
|
|
|
def downgrade() -> None:
|
|
# ### commands auto generated by Alembic - please adjust! ###
|
|
op.drop_constraint('person_id', 'medical_cards', type_='unique')
|
|
# ### end Alembic commands ###
|