-
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 remote-tracking branch 'origin/release-0.2.0' into fix/kevin-1400
- Loading branch information
Showing
73 changed files
with
1,401 additions
and
524 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
25 changes: 25 additions & 0 deletions
25
backend/lcfs/db/migrations/versions/2024-12-06-09-59_9206124a098b.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,25 @@ | ||
"""Add Organization name to FSE | ||
Revision ID: 9206124a098b | ||
Revises: aeaa26f5cdd5 | ||
Create Date: 2024-12-04 09:59:22.876386 | ||
""" | ||
from alembic import op | ||
import sqlalchemy as sa | ||
|
||
# revision identifiers, used by Alembic. | ||
revision = '9206124a098b' | ||
down_revision = '26ab15f8ab18' | ||
branch_labels = None | ||
depends_on = None | ||
|
||
|
||
def upgrade(): | ||
# Add the column 'organization_name' to 'final_supply_equipment' table | ||
op.add_column("final_supply_equipment", sa.Column("organization_name", sa.String(), nullable=True)) | ||
|
||
|
||
def downgrade(): | ||
# Remove the column 'organization_name' from 'final_supply_equipment' table | ||
op.drop_column("final_supply_equipment", "organization_name") |
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
95 changes: 95 additions & 0 deletions
95
backend/lcfs/db/migrations/versions/2024-12-09-23-31_7ae38a8413ab.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,95 @@ | ||
"""Update Fuel Types measured in volume to be other-uses | ||
Revision ID: 7ae38a8413ab | ||
Revises: 26ab15f8ab18 | ||
Create Date: 2024-12-09 19:31:18.199089 | ||
""" | ||
|
||
import sqlalchemy as sa | ||
from alembic import op | ||
from datetime import datetime | ||
|
||
# revision identifiers, used by Alembic. | ||
revision = "7ae38a8413ab" | ||
down_revision = "cd8698fe40e6" | ||
branch_labels = None | ||
depends_on = None | ||
|
||
|
||
def upgrade() -> None: | ||
current_time = datetime.now() | ||
|
||
# Update the `other_uses_fossil_derived` field for all specified fuel types | ||
op.execute( | ||
f""" | ||
UPDATE fuel_type | ||
SET other_uses_fossil_derived = true, | ||
update_date = '{current_time}', | ||
update_user = 'no_user' | ||
WHERE fuel_type IN ( | ||
'Alternative jet fuel', | ||
'Biodiesel', | ||
'Ethanol', | ||
'HDRD', | ||
'Renewable gasoline', | ||
'Renewable naphtha' | ||
) | ||
""" | ||
) | ||
|
||
# Update the `other_uses_fossil_derived` field for all specified fuel types | ||
op.execute( | ||
f""" | ||
UPDATE fuel_type | ||
SET other_uses_fossil_derived = false, | ||
update_date = '{current_time}', | ||
update_user = 'no_user' | ||
WHERE fuel_type IN ( | ||
'CNG', | ||
'Electricity', | ||
'Hydrogen', | ||
'LNG', | ||
'Propane' | ||
) | ||
""" | ||
) | ||
|
||
|
||
def downgrade() -> None: | ||
current_time = datetime.now() | ||
|
||
# Revert the `other_uses_fossil_derived` field to false for the first set of fuel types | ||
op.execute( | ||
f""" | ||
UPDATE fuel_type | ||
SET other_uses_fossil_derived = false, | ||
update_date = '{current_time}', | ||
update_user = 'no_user' | ||
WHERE fuel_type IN ( | ||
'Alternative jet fuel', | ||
'Biodiesel', | ||
'Ethanol', | ||
'HDRD', | ||
'Renewable gasoline', | ||
'Renewable naphtha' | ||
) | ||
""" | ||
) | ||
|
||
# Revert the `other_uses_fossil_derived` field to true for the second set of fuel types | ||
op.execute( | ||
f""" | ||
UPDATE fuel_type | ||
SET other_uses_fossil_derived = true, | ||
update_date = '{current_time}', | ||
update_user = 'no_user' | ||
WHERE fuel_type IN ( | ||
'CNG', | ||
'Electricity', | ||
'Hydrogen', | ||
'LNG', | ||
'Propane' | ||
) | ||
""" | ||
) |
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.