health-apps-backend/migrations/versions/5ed8ac3d258c_updated_enums_...

38 lines
1.2 KiB
Python

"""updated_enums_clinic_status
Revision ID: 5ed8ac3d258c
Revises: a19fede0cdc6
Create Date: 2025-06-02 11:11:56.589321
"""
from typing import Sequence, Union
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision: str = '5ed8ac3d258c'
down_revision: Union[str, None] = 'a19fede0cdc6'
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! ###
# Add new status to clinicstatus enum
op.execute("ALTER TYPE clinicstatus ADD VALUE IF NOT EXISTS 'SUBSCRIPTION_ENDED' AFTER 'PAYMENT_DUE'")
# ### end Alembic commands ###
def downgrade() -> None:
"""Downgrade schema."""
# ### commands auto generated by Alembic - please adjust! ###
# Note: In PostgreSQL, you cannot directly remove an enum value.
# You would need to create a new enum type, update the column to use the new type,
# and then drop the old type. This is a complex operation and might not be needed.
# The upgrade will be reverted when applying previous migrations.
pass
# ### end Alembic commands ###