generated from bcgov/EPIC.scaffold
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
82e1228
commit 8fdd291
Showing
6 changed files
with
100 additions
and
13 deletions.
There are no files selected for viewing
35 changes: 35 additions & 0 deletions
35
compliance-api/migrations/versions/e2f642264b01_inspection_status_enum_change.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
"""inspection_status_enum change | ||
Revision ID: e2f642264b01 | ||
Revises: 36a31040a452 | ||
Create Date: 2024-12-13 09:49:30.968604 | ||
""" | ||
from alembic import op | ||
import sqlalchemy as sa | ||
from sqlalchemy.dialects import postgresql | ||
|
||
# revision identifiers, used by Alembic. | ||
revision = 'e2f642264b01' | ||
down_revision = '36a31040a452' | ||
branch_labels = None | ||
depends_on = None | ||
|
||
|
||
def upgrade(): | ||
# ### commands auto generated by Alembic - please adjust! ### | ||
op.execute("ALTER TYPE inspectionstatusenum ADD VALUE 'CANCELED'") | ||
# ### end Alembic commands ### | ||
|
||
|
||
def downgrade(): | ||
# ### commands auto generated by Alembic - please adjust! ### | ||
op.execute("ALTER TYPE inspectionstatusenum RENAME TO inspectionstatusenum_old") | ||
op.execute("CREATE TYPE inspectionstatusenum AS ENUM('OPEN', 'CLOSED')") | ||
op.execute(""" | ||
ALTER TABLE inspections | ||
ALTER COLUMN inspection_status | ||
TYPE inspectionstatusenum | ||
USING inspection_status::text::inspectionstatusenum | ||
""") | ||
# ### end Alembic commands ### |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,3 +21,4 @@ class InspectionStatusEnum(enum.Enum): | |
|
||
OPEN = "Open" | ||
CLOSED = "Closed" | ||
CANCELED = "Canceled" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters