-
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 refactor/hamed-bceid-dashboard-link…
…-updates-1403
- Loading branch information
Showing
55 changed files
with
2,286 additions
and
205 deletions.
There are no files selected for viewing
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") |
34 changes: 34 additions & 0 deletions
34
backend/lcfs/db/migrations/versions/2024-12-09-22-33_cd8698fe40e6.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,34 @@ | ||
"""Remove notifications email from user_profile | ||
Revision ID: cd8698fe40e6 | ||
Revises: 26ab15f8ab18 | ||
Create Date: 2024-12-09 22:33:29.554360 | ||
""" | ||
|
||
import sqlalchemy as sa | ||
from alembic import op | ||
|
||
# revision identifiers, used by Alembic. | ||
revision = "cd8698fe40e6" | ||
down_revision = "9206124a098b" | ||
branch_labels = None | ||
depends_on = None | ||
|
||
|
||
def upgrade() -> None: | ||
# Remove notifications_email column from user_profile table | ||
op.drop_column("user_profile", "notifications_email") | ||
|
||
|
||
def downgrade() -> None: | ||
# Add notifications_email column to user_profile table | ||
op.add_column( | ||
"user_profile", | ||
sa.Column( | ||
"notifications_email", | ||
sa.String(length=255), | ||
nullable=True, | ||
comment="Email address used for notifications", | ||
), | ||
) |
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
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.