feat: clinic and user table change

feat: centralized db error handler
fix: api responses
This commit is contained in:
2025-05-16 13:24:26 +05:30
parent 2efc09cf20
commit 30f51618fe
18 changed files with 338 additions and 80 deletions
@@ -0,0 +1,34 @@
"""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 ###
+32
View File
@@ -0,0 +1,32 @@
"""user
Revision ID: ad47f4af583e
Revises: 402a9152a6fc
Create Date: 2025-05-15 16:40:24.114531
"""
from typing import Sequence, Union
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision: str = 'ad47f4af583e'
down_revision: Union[str, None] = '402a9152a6fc'
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('users', sa.Column('mobile', sa.String(), nullable=True))
# ### end Alembic commands ###
def downgrade() -> None:
"""Downgrade schema."""
# ### commands auto generated by Alembic - please adjust! ###
op.drop_column('users', 'mobile')
# ### end Alembic commands ###