-
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.
Reconfigure provision of the act for other fuel diesel
- Loading branch information
Showing
3 changed files
with
39 additions
and
2 deletions.
There are no files selected for viewing
37 changes: 37 additions & 0 deletions
37
backend/lcfs/db/migrations/versions/2025-01-03-13-24_bfa7bbb1eea3.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,37 @@ | ||
"""Update fuel type name | ||
Revision ID: bfa7bbb1eea3 | ||
Revises: 9329e38396e1 | ||
Create Date: 2025-01-03 13:24:19.525006 | ||
""" | ||
|
||
import sqlalchemy as sa | ||
from alembic import op | ||
|
||
# revision identifiers, used by Alembic. | ||
revision = "bfa7bbb1eea3" | ||
down_revision = "9329e38396e1" | ||
branch_labels = None | ||
depends_on = None | ||
|
||
|
||
def upgrade() -> None: | ||
# Update fuel type name | ||
op.execute(""" | ||
UPDATE fuel_type | ||
SET fuel_type = 'Other diesel fuel', | ||
provision_1_id = 3 -- Change from prescribed (1) to default (3) | ||
WHERE fuel_type = 'Other diesel'; | ||
""") | ||
|
||
|
||
def downgrade() -> None: | ||
# Revert fuel type name update | ||
op.execute(""" | ||
UPDATE fuel_type | ||
SET fuel_type = 'Other diesel', | ||
provision_1_id = 1 -- Change from default (3) to prescribed (1) | ||
WHERE fuel_type = 'Other diesel fuel'; | ||
""") | ||
|
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