feat: appointment relation table

fix: relations for clinic doc and clinic
This commit is contained in:
2025-05-13 11:15:29 +05:30
parent c235196990
commit dabc7dd308
13 changed files with 166 additions and 3 deletions
@@ -0,0 +1,33 @@
"""appointment relation table
Revision ID: a3a9b7d17bdd
Revises: 827c736d4aeb
Create Date: 2025-05-13 11:09:24.512689
"""
from typing import Sequence, Union
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision: str = 'a3a9b7d17bdd'
down_revision: Union[str, None] = '827c736d4aeb'
branch_labels: Union[str, Sequence[str], None] = None
depends_on: Union[str, Sequence[str], None] = None
def upgrade() -> None:
"""Upgrade schema."""
op.add_column('clinic_doctors', sa.Column('clinic_id', sa.Integer(), nullable=True))
op.create_foreign_key(None, 'clinic_doctors', 'clinics', ['clinic_id'], ['id'])
# ### end Alembic commands ###
def downgrade() -> None:
"""Downgrade schema."""
# ### commands auto generated by Alembic - please adjust! ###
op.drop_constraint(None, 'clinic_doctors', type_='foreignkey')
op.drop_column('clinic_doctors', 'clinic_id')
# ### end Alembic commands ###