35 lines
1000 B
Python
35 lines
1000 B
Python
"""clinic-user-relation
|
|
|
|
Revision ID: 402a9152a6fc
|
|
Revises: ac71b9a4b040
|
|
Create Date: 2025-05-15 12:09:28.050689
|
|
|
|
"""
|
|
from typing import Sequence, Union
|
|
|
|
from alembic import op
|
|
import sqlalchemy as sa
|
|
|
|
|
|
# revision identifiers, used by Alembic.
|
|
revision: str = '402a9152a6fc'
|
|
down_revision: Union[str, None] = 'ac71b9a4b040'
|
|
branch_labels: Union[str, Sequence[str], None] = None
|
|
depends_on: Union[str, Sequence[str], None] = None
|
|
|
|
|
|
def upgrade() -> None:
|
|
"""Upgrade schema."""
|
|
# ### commands auto generated by Alembic - please adjust! ###
|
|
op.add_column('clinics', sa.Column('creator_id', sa.Integer(), nullable=True))
|
|
op.create_foreign_key(None, 'clinics', 'users', ['creator_id'], ['id'])
|
|
# ### end Alembic commands ###
|
|
|
|
|
|
def downgrade() -> None:
|
|
"""Downgrade schema."""
|
|
# ### commands auto generated by Alembic - please adjust! ###
|
|
op.drop_constraint(None, 'clinics', type_='foreignkey')
|
|
op.drop_column('clinics', 'creator_id')
|
|
# ### end Alembic commands ###
|