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.
Merge pull request #221 from dinesh-aot/COMP-317
Close status for inspection
- Loading branch information
Showing
7 changed files
with
64 additions
and
13 deletions.
There are no files selected for viewing
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
46 changes: 46 additions & 0 deletions
46
compliance-api/migrations/versions/3aa492aa47db_remove_closed_as_note_status.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,46 @@ | ||
"""Remove closed as note status | ||
Revision ID: 3aa492aa47db | ||
Revises: 91f76d883f32 | ||
Create Date: 2025-02-06 13:22:09.682441 | ||
""" | ||
from alembic import op | ||
import sqlalchemy as sa | ||
|
||
|
||
# revision identifiers, used by Alembic. | ||
revision = '3aa492aa47db' | ||
down_revision = '91f76d883f32' | ||
branch_labels = None | ||
depends_on = None | ||
|
||
|
||
def upgrade(): | ||
# ### commands auto generated by Alembic - please adjust! ### | ||
op.execute("UPDATE inspections set inspection_status='CLOSED' WHERE inspection_status='CLOSED_AS_NOTE'") | ||
op.execute("UPDATE inspections_version SET inspection_status='CLOSED' WHERE inspection_status='CLOSED_AS_NOTE'") | ||
op.execute(""" | ||
CREATE TYPE inspectionstatusenum_old AS ENUM ('OPEN', 'CLOSED', 'CANCELED'); | ||
""") | ||
op.execute(""" | ||
ALTER TABLE inspections | ||
ALTER COLUMN inspection_status TYPE inspectionstatusenum_old | ||
USING inspection_status::text::inspectionstatusenum_old; | ||
""") | ||
op.execute(""" | ||
ALTER TABLE inspections_version | ||
ALTER COLUMN inspection_status TYPE inspectionstatusenum_old | ||
USING inspection_status::text::inspectionstatusenum_old; | ||
""") | ||
op.execute("DROP TYPE inspectionstatusenum;") | ||
op.execute("ALTER TYPE inspectionstatusenum_old RENAME TO inspectionstatusenum;") | ||
|
||
# ### end Alembic commands ### | ||
|
||
|
||
def downgrade(): | ||
# ### commands auto generated by Alembic - please adjust! ### | ||
pass | ||
|
||
# ### 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
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