-
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 branch 'release-0.2.0' into fix/prashanth-transactions-comments…
…-fix-1702
- Loading branch information
Showing
33 changed files
with
211 additions
and
102 deletions.
There are no files selected for viewing
61 changes: 61 additions & 0 deletions
61
backend/lcfs/db/migrations/versions/2025-01-14-18-12_fe03799b4018.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,61 @@ | ||
"""Update other_uses_fossil_derived in fuel_type | ||
Revision ID: fe03799b4018 | ||
Revises: fa98709e7952 | ||
Create Date: 2025-01-14 18:12:43.683691 | ||
""" | ||
|
||
import sqlalchemy as sa | ||
from alembic import op | ||
|
||
# revision identifiers, used by Alembic. | ||
revision = "fe03799b4018" | ||
down_revision = "5163af6ba4a4" | ||
branch_labels = None | ||
depends_on = None | ||
|
||
|
||
def upgrade() -> None: | ||
# Set other_uses_fossil_derived to false | ||
op.execute(""" | ||
UPDATE fuel_type | ||
SET other_uses_fossil_derived = false | ||
WHERE fuel_type IN ( | ||
'CNG', 'Electricity', 'Hydrogen', 'LNG', 'Propane', | ||
'Natural gas-based gasoline', 'Petroleum-based diesel', | ||
'Petroleum-based gasoline' | ||
) | ||
""") | ||
|
||
# Set other_uses_fossil_derived to true | ||
op.execute(""" | ||
UPDATE fuel_type | ||
SET other_uses_fossil_derived = true | ||
WHERE fuel_type IN ( | ||
'Alternative jet fuel', 'Biodiesel', 'Ethanol', 'HDRD', | ||
'Other diesel fuel', 'Renewable gasoline', 'Renewable naphtha' | ||
) | ||
""") | ||
|
||
def downgrade() -> None: | ||
# Revert `other_uses_fossil_derived` to original values for false | ||
op.execute(""" | ||
UPDATE fuel_type | ||
SET other_uses_fossil_derived = true | ||
WHERE fuel_type IN ( | ||
'CNG', 'Electricity', 'Hydrogen', 'LNG', 'Propane', | ||
'Natural gas-based gasoline', 'Petroleum-based diesel', | ||
'Petroleum-based gasoline' | ||
) | ||
""") | ||
|
||
# Revert `other_uses_fossil_derived` to original values for true | ||
op.execute(""" | ||
UPDATE fuel_type | ||
SET other_uses_fossil_derived = false | ||
WHERE fuel_type IN ( | ||
'Alternative jet fuel', 'Biodiesel', 'Ethanol', 'HDRD', | ||
'Other diesel fuel', 'Renewable gasoline', 'Renewable naphtha' | ||
) | ||
""") |
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
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 was deleted.
Oops, something went wrong.
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
Oops, something went wrong.