-
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 pull request #1713 from bcgov/feat/kevin-1602
feat: fuel code etl improvements
- Loading branch information
Showing
6 changed files
with
552 additions
and
73 deletions.
There are no files selected for viewing
44 changes: 44 additions & 0 deletions
44
backend/lcfs/db/migrations/versions/2025-01-15-22-48_5bc0ef48739a.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,44 @@ | ||
"""add truck and marine transport mode | ||
Revision ID: 5bc0ef48739a | ||
Revises: f78e53370ed2 | ||
Create Date: 2025-01-15 22:48:43.582069 | ||
""" | ||
|
||
import sqlalchemy as sa | ||
from alembic import op | ||
from datetime import datetime | ||
|
||
# revision identifiers, used by Alembic. | ||
revision = "5bc0ef48739a" | ||
down_revision = "8119d12538df" | ||
branch_labels = None | ||
depends_on = None | ||
|
||
|
||
def upgrade() -> None: | ||
current_time = datetime.now() | ||
|
||
# Insert Truck and Marine transport modes | ||
op.execute( | ||
""" | ||
INSERT INTO transport_mode (transport_mode, create_date, update_date, create_user, update_user) | ||
VALUES | ||
('Truck', '{}', '{}', 'no_user', 'no_user'), | ||
('Marine', '{}', '{}', 'no_user', 'no_user') | ||
""".format( | ||
current_time, current_time, current_time, current_time | ||
) | ||
) | ||
|
||
|
||
def downgrade() -> None: | ||
# Remove Truck and Marine transport modes | ||
op.execute( | ||
""" | ||
DELETE FROM transport_mode | ||
WHERE transport_mode IN ('Truck', 'Marine') | ||
""" | ||
) |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Oops, something went wrong.