Skip to content

Commit

Permalink
Merge branch 'main' into task/vitejs
Browse files Browse the repository at this point in the history
  • Loading branch information
jmetev1 authored Sep 5, 2024
2 parents a7e258d + 3d1486a commit c96b92c
Show file tree
Hide file tree
Showing 14 changed files with 1,270 additions and 10 deletions.
9 changes: 8 additions & 1 deletion .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -117,12 +117,19 @@
"console": "integratedTerminal",
},
{
"name": "app.jobs.rdps_sfms ",
"name": "app.jobs.rdps_sfms",
"type": "python",
"request": "launch",
"module": "app.jobs.rdps_sfms",
"console": "integratedTerminal"
},
{
"name": "local critical hours",
"type": "python",
"request": "launch",
"module": "app.auto_spatial_advisory.critical_hours",
"console": "integratedTerminal"
},
{
"name": "Chrome",
"type": "pwa-chrome",
Expand Down
2 changes: 2 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@
"excinfo",
"fastapi",
"FBAN",
"ffmc",
"fireweather",
"firezone",
"GDPS",
Expand Down Expand Up @@ -109,6 +110,7 @@
"reproject",
"rocketchat",
"rollup",
"rtol",
"sessionmaker",
"sfms",
"sqlalchemy",
Expand Down
56 changes: 56 additions & 0 deletions api/alembic/versions/c9e46d098c73_critical_hours.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
"""Critical hours
Revision ID: c9e46d098c73
Revises: 6910d017b626
Create Date: 2024-08-12 16:24:00.489375
"""

from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import postgresql

# revision identifiers, used by Alembic.
revision = "c9e46d098c73"
down_revision = "6910d017b626"
branch_labels = None
depends_on = None


def upgrade():
op.create_table(
"critical_hours",
sa.Column("id", sa.Integer(), nullable=False),
sa.Column("advisory_shape_id", sa.Integer(), nullable=False),
sa.Column("threshold", sa.Enum("advisory", "warning", name="hficlassificationthresholdenum"), nullable=False),
sa.Column("run_parameters", sa.Integer(), nullable=False),
sa.Column("fuel_type", sa.Integer(), nullable=False),
sa.Column("start_hour", sa.Integer(), nullable=False),
sa.Column("end_hour", sa.Integer(), nullable=False),
sa.ForeignKeyConstraint(
["advisory_shape_id"],
["advisory_shapes.id"],
),
sa.ForeignKeyConstraint(
["fuel_type"],
["sfms_fuel_types.id"],
),
sa.ForeignKeyConstraint(
["run_parameters"],
["run_parameters.id"],
),
sa.PrimaryKeyConstraint("id"),
comment="Critical hours by firezone unit, fuel type and sfms run parameters.",
)
op.create_index(op.f("ix_critical_hours_advisory_shape_id"), "critical_hours", ["advisory_shape_id"], unique=False)
op.create_index(op.f("ix_critical_hours_fuel_type"), "critical_hours", ["fuel_type"], unique=False)
op.create_index(op.f("ix_critical_hours_id"), "critical_hours", ["id"], unique=False)
op.create_index(op.f("ix_critical_hours_run_parameters"), "critical_hours", ["run_parameters"], unique=False)


def downgrade():
op.drop_index(op.f("ix_critical_hours_run_parameters"), table_name="critical_hours")
op.drop_index(op.f("ix_critical_hours_id"), table_name="critical_hours")
op.drop_index(op.f("ix_critical_hours_fuel_type"), table_name="critical_hours")
op.drop_index(op.f("ix_critical_hours_advisory_shape_id"), table_name="critical_hours")
op.drop_table("critical_hours")
Loading

0 comments on commit c96b92c

Please sign in to comment.