Skip to content

Commit

Permalink
Merge pull request #1839 from bcgov/fix/alex-uci-opts-1825
Browse files Browse the repository at this point in the history
fix: updated intended use flags on correct records
  • Loading branch information
AlexZorkin authored Jan 29, 2025
2 parents f0c3540 + df86942 commit ccc9962
Showing 1 changed file with 47 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
"""Update intended use flags
Revision ID: 0d8e7ee6a6e0
Revises: 26bb41f15dc4
Create Date: 2025-01-28 16:15:20.208093
"""

import sqlalchemy as sa
from alembic import op

# revision identifiers, used by Alembic.
revision = "0d8e7ee6a6e0"
down_revision = "26bb41f15dc4"
branch_labels = None
depends_on = None


def upgrade() -> None:
# Ensure that only the specified types have intended_use set to TRUE
op.execute(
"""
UPDATE end_use_type
SET intended_use = CASE
WHEN type IN (
'Light duty motor vehicles',
'Battery bus',
'Battery truck',
'Cargo handling equipment',
'Fixed guiderail',
'Ground support equipment',
'Heavy forklift',
'Marine',
'Shore power',
'Trolley bus',
'Other',
'Any',
'Aircraft'
) THEN TRUE
ELSE FALSE
END;
"""
)


def downgrade() -> None:
pass

0 comments on commit ccc9962

Please sign in to comment.