Skip to content

Commit

Permalink
TRACK-307, add new ministries (#2492)
Browse files Browse the repository at this point in the history
  • Loading branch information
tom0827 authored Jan 6, 2025
1 parent 5676774 commit 2548a21
Showing 1 changed file with 32 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
"""add new ministries
Revision ID: eccbb8b96011
Revises: 09fb62ec79e9
Create Date: 2025-01-02 15:19:17.743999
"""
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import postgresql

# revision identifiers, used by Alembic.
revision = 'eccbb8b96011'
down_revision = '09fb62ec79e9'
branch_labels = None
depends_on = None


def upgrade():
op.execute("UPDATE ministries SET sort_order = sort_order + 7 WHERE name != 'Not Applicable'")
op.execute("INSERT INTO ministries (name,abbreviation,sort_order) values ('Mining and Critical Minerals','MCM',2)")
op.execute("INSERT INTO ministries (name,abbreviation,sort_order) values ('Forests','FOR',3)")
op.execute("INSERT INTO ministries (name,abbreviation,sort_order) values ('Jobs, Economic Development and Innovation','JEDI',4)")
op.execute("INSERT INTO ministries (name,abbreviation,sort_order) values ('Tourism, Arts, Culture and Sport','TACS',5)")
op.execute("INSERT INTO ministries (name,abbreviation,sort_order) values ('Housing and Municipal Affairs','HOUS',6)")
op.execute("INSERT INTO ministries (name,abbreviation,sort_order) values ('Water, Land and Resource Stewardship','WLRS',7)")
op.execute("INSERT INTO ministries (name,abbreviation,sort_order) values ('Transportation and Transit','MOTI',8)")


def downgrade():
op.execute("DELETE FROM ministries WHERE name IN ('Mining and Critical Minerals', 'Forests', 'Jobs, Economic Development and Innovation', 'Tourism, Arts, Culture and Sport', 'Housing and Municipal Affairs', 'Water, Land and Resource Stewardship', 'Transportation and Transit')")
op.execute("UPDATE ministries SET sort_order = sort_order - 7 WHERE name != 'Not Applicable'")

0 comments on commit 2548a21

Please sign in to comment.