Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Add Marine Use #1502

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
"""Add Marine End Use

Revision ID: 909969082dfb
Revises: 851e09cf8661
Create Date: 2024-12-18 19:43:06.680781

"""

import sqlalchemy as sa
from alembic import op

# revision identifiers, used by Alembic.
revision = "909969082dfb"
down_revision = "851e09cf8661"
branch_labels = None
depends_on = None


def upgrade() -> None:
op.execute(
"""
INSERT INTO "end_use_type" ("type", "intended_use", "create_user", "update_user") VALUES ('Marine', 't', 'no_user', 'no_user');
"""
)

op.execute(
"""
INSERT INTO "public"."energy_effectiveness_ratio" ("fuel_category_id", "fuel_type_id", "end_use_type_id", "ratio", "create_user", "update_user", "effective_status") VALUES (2, 3, (SELECT end_use_type_id FROM "end_use_type" WHERE "type" = 'Marine'), 2.5, 'no_user', 'no_user', 't');
"""
)


def downgrade() -> None:
# Remove the inserted energy_effectiveness_ratio entry
op.execute(
"""
DELETE FROM "public"."energy_effectiveness_ratio"
WHERE end_use_type_id = (SELECT end_use_type_id FROM "end_use_type" WHERE "type" = 'Marine');
"""
)

# Remove the inserted end_use_type entry
op.execute(
"""
DELETE FROM "end_use_type"
WHERE "type" = 'Marine';
"""
)
12 changes: 12 additions & 0 deletions backend/lcfs/db/seeders/common/seed_fuel_data.json
Original file line number Diff line number Diff line change
Expand Up @@ -377,6 +377,11 @@
"end_use_type_id": 23,
"type": "Other (i.e. road transportation)",
"intended_use": true
},
{
"end_use_type_id": 24,
"type": "Marine",
"intended_use": true
}
],
"unit_of_measures": [
Expand Down Expand Up @@ -686,6 +691,13 @@
"fuel_type_id": 7,
"end_use_type_id": 23,
"ratio": 0.9
},
{
"eer_id": 31,
"fuel_category_id": 2,
"fuel_type_id": 3,
"end_use_type_id": 24,
"ratio": 2.5
}
],
"energy_densities": [
Expand Down
Loading