-
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 feat/daniel-add-is-legacy-1550
- Loading branch information
Showing
18 changed files
with
218 additions
and
54 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
67 changes: 67 additions & 0 deletions
67
backend/lcfs/db/migrations/versions/2025-01-03-23-31_e883ad1f0f60.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,67 @@ | ||
"""Rename Reassessed | ||
Revision ID: e883ad1f0f60 | ||
Revises: 9329e38396e1 | ||
Create Date: 2025-01-03 23:31:19.098618 | ||
""" | ||
|
||
import sqlalchemy as sa | ||
from alembic import op | ||
from alembic_postgresql_enum import TableReference | ||
|
||
# revision identifiers, used by Alembic. | ||
revision = "e883ad1f0f60" | ||
down_revision = "9329e38396e1" | ||
branch_labels = None | ||
depends_on = None | ||
|
||
|
||
def upgrade() -> None: | ||
# ### commands auto generated by Alembic - please adjust! ### | ||
op.sync_enum_values( | ||
"public", | ||
"compliancereportstatusenum", | ||
[ | ||
"Draft", | ||
"Submitted", | ||
"Recommended_by_analyst", | ||
"Recommended_by_manager", | ||
"Assessed", | ||
"Reassessed", | ||
], | ||
[ | ||
TableReference( | ||
table_schema="public", | ||
table_name="compliance_report_status", | ||
column_name="status", | ||
) | ||
], | ||
enum_values_to_rename=[("ReAssessed", "Reassessed")], | ||
) | ||
# ### end Alembic commands ### | ||
|
||
|
||
def downgrade() -> None: | ||
# ### commands auto generated by Alembic - please adjust! ### | ||
op.sync_enum_values( | ||
"public", | ||
"compliancereportstatusenum", | ||
[ | ||
"Draft", | ||
"Submitted", | ||
"Recommended_by_analyst", | ||
"Recommended_by_manager", | ||
"Assessed", | ||
"ReAssessed", | ||
], | ||
[ | ||
TableReference( | ||
table_schema="public", | ||
table_name="compliance_report_status", | ||
column_name="status", | ||
) | ||
], | ||
enum_values_to_rename=[("Reassessed", "ReAssessed")], | ||
) | ||
# ### end Alembic commands ### |
37 changes: 37 additions & 0 deletions
37
backend/lcfs/db/migrations/versions/2025-01-04-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 = "e883ad1f0f60" | ||
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
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
Oops, something went wrong.