diff --git a/.sonarcloud.properties b/.sonarcloud.properties index 5bac964745..8a20a3fd59 100644 --- a/.sonarcloud.properties +++ b/.sonarcloud.properties @@ -16,7 +16,7 @@ sonar.test.exclusions=*.feature sonar.tests.inclusions=**/*.test.tsx # Exclude duplication in fba tests due to many similar calculation numbers, ignore sample code as it's temporary, ignore sfms entrypoint, ignore util tests, ignore temporary fwi folder -sonar.cpd.exclusions=api/app/tests/fba_calc/*.py, api/app/weather_models/wind_direction_sample.py, web/src/features/moreCast2/util.test.ts, web/src/features/moreCast2/components/gridComponentRenderer.test.tsx, web/src/utils/fwi, mobile/asa-go/src/**, mobile/asa-go/**/*.test.tsx, mobile/asa-go/**/*.test.ts +sonar.cpd.exclusions=api/app/tests/fba_calc/*.py, api/app/weather_models/wind_direction_sample.py, web/src/features/moreCast2/util.test.ts, web/src/features/moreCast2/components/gridComponentRenderer.test.tsx, web/src/utils/fwi, mobile/asa-go/src/**, mobile/asa-go/**/*.test.tsx, mobile/asa-go/**/*.test.ts, backend/packages/wps-api/alembic/versions/archive/** # Encoding of the source code. Default is default system encoding sonar.sourceEncoding=UTF-8 diff --git a/backend/packages/wps-api/alembic/data/application_seed_data.sql.gz b/backend/packages/wps-api/alembic/data/application_seed_data.sql.gz new file mode 100644 index 0000000000..5893acde2d Binary files /dev/null and b/backend/packages/wps-api/alembic/data/application_seed_data.sql.gz differ diff --git a/backend/packages/wps-api/alembic/env.py b/backend/packages/wps-api/alembic/env.py index dc0e7889fd..8c0a482d16 100644 --- a/backend/packages/wps-api/alembic/env.py +++ b/backend/packages/wps-api/alembic/env.py @@ -79,6 +79,37 @@ def run_migrations_offline(): def do_run_migrations(connection): + """Run migrations with automatic stamping for production databases.""" + import os + from alembic.script import ScriptDirectory + from alembic.migration import MigrationContext + + # Check if we should auto-stamp (production only) + is_production = os.getenv("ENVIRONMENT", "").lower() in ("production", "prod") + + if is_production: + # Get current database version + migration_context = MigrationContext.configure(connection) + current_rev = migration_context.get_current_revision() + + # d276ba9eed1f is the last migration before compression + # If production database is at this revision, stamp to last commit of the squashed migrations, then run any further migrations + if current_rev == "d276ba9eed1f": + script = ScriptDirectory.from_config(config) + head_revision = script.get_current_head() + + # Ensure head is the expected compressed migration (seed data) + assert head_revision == "cf8397b26783", ( + f"Expected head revision cf8397b26783 but got {head_revision}" + ) + + # Stamp the database to the seed application data migration, it should run the migrations after it + connection.execute( + sqlalchemy.text("UPDATE alembic_version SET version_num = '6157a8d08f28'") + ) + connection.commit() + print(f"✓ Production database stamped from {current_rev} to 6157a8d08f28") + context.configure(connection=connection, target_metadata=target_metadata) with context.begin_transaction(): diff --git a/backend/packages/wps-api/alembic/versions/6157a8d08f28_seed_application_data.py b/backend/packages/wps-api/alembic/versions/6157a8d08f28_seed_application_data.py new file mode 100644 index 0000000000..dfb9a937fd --- /dev/null +++ b/backend/packages/wps-api/alembic/versions/6157a8d08f28_seed_application_data.py @@ -0,0 +1,100 @@ +"""seed_application_data + +Revision ID: 6157a8d08f28 +Revises: 9bb0dc8ed7fb +Create Date: 2025-12-29 14:44:23.524448 + +""" + +from alembic import op +import sqlalchemy as sa +from pathlib import Path +import re +import gzip +from shapely import wkb + + +# revision identifiers, used by Alembic. +revision = "6157a8d08f28" +down_revision = "9bb0dc8ed7fb" +branch_labels = None +depends_on = None + + +def transform_geometry_values(statement: str) -> str: + """Transform PostGIS geometry hex strings to use ST_GeomFromEWKB() with decode() + + Uses shapely to validate that hex strings are actually valid WKB geometry data + before transforming them. + """ + # Pattern to match hex strings that look like PostGIS EWKB format + pattern = r"'(01[0-9A-Fa-f]{8,})'" + + def replace_hex(match: re.Match[str]) -> str: + hex_string = match.group(1) + try: + # Use shapely to validate this is actually WKB geometry data + wkb.loads(bytes.fromhex(hex_string)) + # If valid, wrap in ST_GeomFromEWKB with decode() to avoid asyncpg parsing + return f"ST_GeomFromEWKB(decode('{hex_string}', 'hex'))" + except Exception: + # Not valid WKB geometry, return original + return match.group(0) + + return re.sub(pattern, replace_hex, statement) + + +def upgrade(): + """Load application data from SQL file""" + # Path to the data file (relative to this migration file) + migration_dir = Path(__file__).parent.parent + data_file = migration_dir / "data" / "application_seed_data.sql.gz" + + if not data_file.exists(): + raise FileNotFoundError(f"Data file not found: {data_file}") + + # Get the connection without prepared statements to avoid asyncpg geometry parsing + connection = op.get_bind().execution_options(prepared=False) + + # Execute each INSERT statement individually + with gzip.open(data_file, "rt") as f: + statement_buffer = [] + + for line in f: + # Skip comments and empty lines + if line.strip().startswith("--") or not line.strip(): + continue + + statement_buffer.append(line) + + # Execute when we hit a semicolon (end of statement) + if line.strip().endswith(";"): + statement = "".join(statement_buffer).strip() + if statement.startswith("INSERT"): + # Transform geometry hex strings to PostGIS function calls + transformed = transform_geometry_values(statement) + connection.execute(sa.text(transformed)) + statement_buffer = [] + + +def downgrade(): + """Remove seeded application data""" + # Delete data from the 18 application tables in reverse dependency order + op.execute("DELETE FROM advisory_shape_fuels;") + op.execute("DELETE FROM advisory_fuel_types;") + op.execute("DELETE FROM tpi_fuel_area;") + op.execute("DELETE FROM combustible_area;") + op.execute("DELETE FROM advisory_shapes;") + op.execute("DELETE FROM advisory_shape_types;") + op.execute("DELETE FROM advisory_hfi_classification_threshold;") + op.execute("DELETE FROM hfi_fire_centre_fire_start_range;") + op.execute("DELETE FROM hfi_fire_start_lookup;") + op.execute("DELETE FROM hfi_fire_start_range;") + op.execute("DELETE FROM planning_weather_stations;") + op.execute("DELETE FROM planning_areas;") + op.execute("DELETE FROM fire_centres;") + op.execute("DELETE FROM fuel_type_raster;") + op.execute("DELETE FROM sfms_fuel_types;") + op.execute("DELETE FROM fuel_types;") + op.execute("DELETE FROM prescription_status;") + op.execute("DELETE FROM prediction_models;") diff --git a/backend/packages/wps-api/alembic/versions/9bb0dc8ed7fb_initial_schema.py b/backend/packages/wps-api/alembic/versions/9bb0dc8ed7fb_initial_schema.py new file mode 100644 index 0000000000..c89ca87fd7 --- /dev/null +++ b/backend/packages/wps-api/alembic/versions/9bb0dc8ed7fb_initial_schema.py @@ -0,0 +1,2005 @@ +"""initial_schema + +Revision ID: 9bb0dc8ed7fb +Revises: +Create Date: 2025-12-29 14:38:46.566192 + +""" + +from alembic import op +import sqlalchemy as sa +from sqlalchemy.dialects import postgresql +import geoalchemy2 +import wps_shared.db.models.common + +# revision identifiers, used by Alembic. +revision = "9bb0dc8ed7fb" +down_revision = None +branch_labels = None +depends_on = None + + +def upgrade(): + # NOTE: PostGIS extension must be installed before running this migration + # Run manually as supervisor: CREATE EXTENSION IF NOT EXISTS postgis; + + # ### commands auto generated by Alembic - please adjust! ### + op.create_table( + "advisory_hfi_classification_threshold", + sa.Column("id", sa.Integer(), nullable=False), + sa.Column("description", sa.String(), nullable=False), + sa.Column("name", sa.String(), nullable=False), + sa.PrimaryKeyConstraint("id"), + comment="The Operational Safe Works Standards specifies that an hfi of greater than 4000 should result in an advisory. However in order for an FBAN to create useful information, there are other thresholds of concern. E.g. > 10000", + ) + op.create_index( + op.f("ix_advisory_hfi_classification_threshold_id"), + "advisory_hfi_classification_threshold", + ["id"], + unique=False, + ) + op.create_table( + "advisory_shape_types", + sa.Column("id", sa.Integer(), nullable=False), + sa.Column( + "name", + sa.Enum("fire_centre", "fire_zone", "fire_zone_unit", name="shapetypeenum"), + nullable=False, + ), + sa.PrimaryKeyConstraint("id"), + comment="Identify kind of advisory area (e.g. Zone, Fire etc.)", + ) + op.create_index( + op.f("ix_advisory_shape_types_name"), "advisory_shape_types", ["name"], unique=True + ) + op.create_table( + "api_access_audits", + sa.Column("id", sa.Integer(), nullable=False), + sa.Column("create_user", sa.String(), nullable=True), + sa.Column("path", sa.String(), nullable=False), + sa.Column("create_timestamp", wps_shared.db.models.common.TZTimeStamp(), nullable=False), + sa.Column("success", sa.Boolean(), nullable=False), + sa.PrimaryKeyConstraint("id"), + comment="The audit log of an authenticated request by a user.", + ) + op.create_index( + op.f("ix_api_access_audits_create_timestamp"), + "api_access_audits", + ["create_timestamp"], + unique=False, + ) + op.create_index( + op.f("ix_api_access_audits_create_user"), "api_access_audits", ["create_user"], unique=False + ) + op.create_index(op.f("ix_api_access_audits_path"), "api_access_audits", ["path"], unique=False) + op.create_table( + "fire_centres", + sa.Column("id", sa.Integer(), nullable=False), + sa.Column("name", sa.String(), nullable=False), + sa.PrimaryKeyConstraint("id"), + ) + op.create_index(op.f("ix_fire_centres_id"), "fire_centres", ["id"], unique=False) + op.create_index(op.f("ix_fire_centres_name"), "fire_centres", ["name"], unique=False) + op.create_table( + "fuel_type_raster", + sa.Column("id", sa.Integer(), nullable=False), + sa.Column("year", sa.Integer(), nullable=False), + sa.Column("version", sa.Integer(), nullable=False), + sa.Column("xsize", sa.Integer(), nullable=False), + sa.Column("ysize", sa.Integer(), nullable=False), + sa.Column("object_store_path", sa.String(), nullable=False), + sa.Column("content_hash", sa.String(), nullable=False), + sa.Column("create_timestamp", wps_shared.db.models.common.TZTimeStamp(), nullable=False), + sa.PrimaryKeyConstraint("id"), + comment="Processed fuel type rasters.", + ) + op.create_table( + "fuel_types", + sa.Column("id", sa.Integer(), nullable=False), + sa.Column("abbrev", sa.String(), nullable=False), + sa.Column("fuel_type_code", sa.String(), nullable=True), + sa.Column("description", sa.String(), nullable=True), + sa.Column("percentage_conifer", sa.Integer(), nullable=True), + sa.Column("percentage_dead_fir", sa.Integer(), nullable=True), + sa.PrimaryKeyConstraint("id"), + ) + op.create_index(op.f("ix_fuel_types_abbrev"), "fuel_types", ["abbrev"], unique=False) + op.create_index(op.f("ix_fuel_types_id"), "fuel_types", ["id"], unique=False) + op.create_table( + "hfi_fire_start_range", + sa.Column("id", sa.Integer(), nullable=False), + sa.Column("label", sa.String(), nullable=False), + sa.PrimaryKeyConstraint("id"), + comment="Fire start range", + ) + op.create_table( + "hourly_actuals", + sa.Column("id", sa.Integer(), nullable=False), + sa.Column("weather_date", wps_shared.db.models.common.TZTimeStamp(), nullable=False), + sa.Column("station_code", sa.Integer(), nullable=False), + sa.Column("temp_valid", sa.Boolean(), nullable=False), + sa.Column("temperature", sa.Float(), nullable=False), + sa.Column("dewpoint", sa.Float(), nullable=True), + sa.Column("rh_valid", sa.Boolean(), nullable=False), + sa.Column("relative_humidity", sa.Float(), nullable=False), + sa.Column("wdir_valid", sa.Boolean(), nullable=False), + sa.Column("wind_direction", sa.Float(), nullable=False), + sa.Column("wspeed_valid", sa.Boolean(), nullable=False), + sa.Column("wind_speed", sa.Float(), nullable=False), + sa.Column("precip_valid", sa.Boolean(), nullable=False), + sa.Column("precipitation", sa.Float(), nullable=False), + sa.Column("ffmc", sa.Float(), nullable=False), + sa.Column("isi", sa.Float(), nullable=False), + sa.Column("fwi", sa.Float(), nullable=False), + sa.Column("created_at", wps_shared.db.models.common.TZTimeStamp(), nullable=False), + sa.PrimaryKeyConstraint("id"), + sa.UniqueConstraint("weather_date", "station_code"), + comment="The hourly_actuals for a weather station and weather date.", + ) + op.create_index( + op.f("ix_hourly_actuals_rh_valid"), "hourly_actuals", ["rh_valid"], unique=False + ) + op.create_index( + op.f("ix_hourly_actuals_station_code"), "hourly_actuals", ["station_code"], unique=False + ) + op.create_index( + op.f("ix_hourly_actuals_temp_valid"), "hourly_actuals", ["temp_valid"], unique=False + ) + op.create_index( + op.f("ix_hourly_actuals_weather_date"), "hourly_actuals", ["weather_date"], unique=False + ) + op.create_table( + "morecast_2_materialized_view", + sa.Column("id", sa.Integer(), nullable=False), + sa.Column("abbreviation", sa.String(), nullable=False), + sa.Column("apcp_sfc_0", sa.Float(), nullable=False), + sa.Column("bias_adjusted_precip_24h", sa.Float(), nullable=False), + sa.Column("bias_adjusted_rh", sa.Float(), nullable=False), + sa.Column("bias_adjusted_temperature", sa.Float(), nullable=False), + sa.Column("bias_adjusted_wind_speed", sa.Float(), nullable=False), + sa.Column("bias_adjusted_wdir", sa.Float(), nullable=False), + sa.Column("precip_24h", sa.Float(), nullable=False), + sa.Column( + "prediction_timestamp", wps_shared.db.models.common.TZTimeStamp(), nullable=False + ), + sa.Column("station_code", sa.Integer(), nullable=True), + sa.Column("rh_tgl_2", sa.Float(), nullable=False), + sa.Column("tmp_tgl_2", sa.Float(), nullable=False), + sa.Column("update_date", wps_shared.db.models.common.TZTimeStamp(), nullable=False), + sa.Column("wdir_tgl_10", sa.Float(), nullable=False), + sa.Column("wind_tgl_10", sa.Float(), nullable=False), + sa.PrimaryKeyConstraint("id"), + ) + op.create_index( + op.f("ix_morecast_2_materialized_view_id"), + "morecast_2_materialized_view", + ["id"], + unique=False, + ) + op.create_index( + op.f("ix_morecast_2_materialized_view_prediction_timestamp"), + "morecast_2_materialized_view", + ["prediction_timestamp"], + unique=False, + ) + op.create_index( + op.f("ix_morecast_2_materialized_view_station_code"), + "morecast_2_materialized_view", + ["station_code"], + unique=False, + ) + op.create_index( + op.f("ix_morecast_2_materialized_view_update_date"), + "morecast_2_materialized_view", + ["update_date"], + unique=False, + ) + op.create_table( + "morecast_forecast", + sa.Column("id", sa.Integer(), nullable=False), + sa.Column("station_code", sa.Integer(), nullable=False), + sa.Column("for_date", wps_shared.db.models.common.TZTimeStamp(), nullable=False), + sa.Column("temp", sa.Float(), nullable=False), + sa.Column("rh", sa.Integer(), nullable=False), + sa.Column("precip", sa.Float(), nullable=False), + sa.Column("wind_speed", sa.Float(), nullable=False), + sa.Column("wind_direction", sa.Integer(), nullable=True), + sa.Column("grass_curing", sa.Float(), nullable=True), + sa.Column("create_timestamp", wps_shared.db.models.common.TZTimeStamp(), nullable=False), + sa.Column("create_user", sa.String(), nullable=False), + sa.Column("update_timestamp", wps_shared.db.models.common.TZTimeStamp(), nullable=False), + sa.Column("update_user", sa.String(), nullable=False), + sa.PrimaryKeyConstraint("id"), + ) + op.create_index( + op.f("ix_morecast_forecast_create_timestamp"), + "morecast_forecast", + ["create_timestamp"], + unique=False, + ) + op.create_index( + op.f("ix_morecast_forecast_for_date"), "morecast_forecast", ["for_date"], unique=False + ) + op.create_index( + op.f("ix_morecast_forecast_grass_curing"), + "morecast_forecast", + ["grass_curing"], + unique=False, + ) + op.create_index(op.f("ix_morecast_forecast_id"), "morecast_forecast", ["id"], unique=False) + op.create_index( + op.f("ix_morecast_forecast_precip"), "morecast_forecast", ["precip"], unique=False + ) + op.create_index(op.f("ix_morecast_forecast_rh"), "morecast_forecast", ["rh"], unique=False) + op.create_index( + op.f("ix_morecast_forecast_station_code"), + "morecast_forecast", + ["station_code"], + unique=False, + ) + op.create_index(op.f("ix_morecast_forecast_temp"), "morecast_forecast", ["temp"], unique=False) + op.create_index( + op.f("ix_morecast_forecast_update_timestamp"), + "morecast_forecast", + ["update_timestamp"], + unique=False, + ) + op.create_index( + op.f("ix_morecast_forecast_wind_direction"), + "morecast_forecast", + ["wind_direction"], + unique=False, + ) + op.create_index( + op.f("ix_morecast_forecast_wind_speed"), "morecast_forecast", ["wind_speed"], unique=False + ) + op.create_table( + "noon_forecasts", + sa.Column("id", sa.Integer(), nullable=False), + sa.Column("weather_date", wps_shared.db.models.common.TZTimeStamp(), nullable=False), + sa.Column("station_code", sa.Integer(), nullable=False), + sa.Column("temp_valid", sa.Boolean(), nullable=False), + sa.Column("temperature", sa.Float(), nullable=False), + sa.Column("rh_valid", sa.Boolean(), nullable=False), + sa.Column("relative_humidity", sa.Float(), nullable=False), + sa.Column("wdir_valid", sa.Boolean(), nullable=False), + sa.Column("wind_direction", sa.Float(), nullable=False), + sa.Column("wspeed_valid", sa.Boolean(), nullable=False), + sa.Column("wind_speed", sa.Float(), nullable=False), + sa.Column("precip_valid", sa.Boolean(), nullable=False), + sa.Column("precipitation", sa.Float(), nullable=False), + sa.Column("gc", sa.Float(), nullable=False), + sa.Column("ffmc", sa.Float(), nullable=False), + sa.Column("dmc", sa.Float(), nullable=False), + sa.Column("dc", sa.Float(), nullable=False), + sa.Column("isi", sa.Float(), nullable=False), + sa.Column("bui", sa.Float(), nullable=False), + sa.Column("fwi", sa.Float(), nullable=False), + sa.Column("created_at", wps_shared.db.models.common.TZTimeStamp(), nullable=False), + sa.Column("wfwx_update_date", wps_shared.db.models.common.TZTimeStamp(), nullable=False), + sa.PrimaryKeyConstraint("id"), + sa.UniqueConstraint("weather_date", "wfwx_update_date", "station_code"), + comment="The noon_forecast for a weather station and weather date.", + ) + op.create_index( + op.f("ix_noon_forecasts_created_at"), "noon_forecasts", ["created_at"], unique=False + ) + op.create_index( + op.f("ix_noon_forecasts_station_code"), "noon_forecasts", ["station_code"], unique=False + ) + op.create_index( + op.f("ix_noon_forecasts_weather_date"), "noon_forecasts", ["weather_date"], unique=False + ) + op.create_index( + op.f("ix_noon_forecasts_wfwx_update_date"), + "noon_forecasts", + ["wfwx_update_date"], + unique=False, + ) + op.create_table( + "percent_grass_curing", + sa.Column("id", sa.Integer(), nullable=False), + sa.Column("station_code", sa.Integer(), nullable=False), + sa.Column("percent_grass_curing", sa.Float(), nullable=False), + sa.Column("for_date", wps_shared.db.models.common.TZTimeStamp(), nullable=False), + sa.PrimaryKeyConstraint("id"), + comment="Record containing information about percent grass curing from the CWFIS.", + ) + op.create_index( + op.f("ix_percent_grass_curing_for_date"), "percent_grass_curing", ["for_date"], unique=False + ) + op.create_index( + op.f("ix_percent_grass_curing_id"), "percent_grass_curing", ["id"], unique=False + ) + op.create_index( + op.f("ix_percent_grass_curing_station_code"), + "percent_grass_curing", + ["station_code"], + unique=False, + ) + op.create_table( + "prediction_models", + sa.Column("id", sa.Integer(), nullable=False), + sa.Column("name", sa.String(), nullable=False), + sa.Column("abbreviation", sa.String(), nullable=False), + sa.Column("projection", sa.String(), nullable=False), + sa.PrimaryKeyConstraint("id"), + sa.UniqueConstraint("abbreviation", "projection"), + comment="Identifies the Weather Prediction model", + ) + op.create_index( + op.f("ix_prediction_models_abbreviation"), + "prediction_models", + ["abbreviation"], + unique=False, + ) + op.create_index(op.f("ix_prediction_models_id"), "prediction_models", ["id"], unique=False) + op.create_table( + "prescription_status", + sa.Column("id", sa.Integer(), nullable=False), + sa.Column("name", sa.String(), nullable=False), + sa.Column("description", sa.String(), nullable=False), + sa.PrimaryKeyConstraint("id"), + sa.UniqueConstraint("name"), + comment="Contains the status of a fire watch prescription.", + ) + op.create_index(op.f("ix_prescription_status_id"), "prescription_status", ["id"], unique=False) + op.create_table( + "processed_model_run_urls", + sa.Column("id", sa.Integer(), nullable=False), + sa.Column("url", sa.String(), nullable=False), + sa.Column("create_date", wps_shared.db.models.common.TZTimeStamp(), nullable=False), + sa.Column("update_date", wps_shared.db.models.common.TZTimeStamp(), nullable=False), + sa.PrimaryKeyConstraint("id"), + comment="Record to indicate that a particular model run file has been processed.", + ) + op.create_index( + op.f("ix_processed_model_run_urls_id"), "processed_model_run_urls", ["id"], unique=False + ) + op.create_index( + op.f("ix_processed_model_run_urls_url"), "processed_model_run_urls", ["url"], unique=True + ) + op.create_table( + "processed_snow", + sa.Column("id", sa.Integer(), nullable=False), + sa.Column("for_date", wps_shared.db.models.common.TZTimeStamp(), nullable=False), + sa.Column("processed_date", wps_shared.db.models.common.TZTimeStamp(), nullable=False), + sa.Column("snow_source", sa.Enum("viirs", name="snowsourceenum"), nullable=False), + sa.PrimaryKeyConstraint("id"), + comment="Record containing information about processed snow coverage data.", + ) + op.create_index( + op.f("ix_processed_snow_for_date"), "processed_snow", ["for_date"], unique=False + ) + op.create_index(op.f("ix_processed_snow_id"), "processed_snow", ["id"], unique=False) + op.create_index( + op.f("ix_processed_snow_processed_date"), "processed_snow", ["processed_date"], unique=False + ) + op.create_index( + op.f("ix_processed_snow_snow_source"), "processed_snow", ["snow_source"], unique=False + ) + op.create_table( + "run_parameters", + sa.Column("id", sa.Integer(), nullable=False), + sa.Column( + "run_type", postgresql.ENUM("actual", "forecast", name="runtypeenum"), nullable=False + ), + sa.Column("run_datetime", wps_shared.db.models.common.TZTimeStamp(), nullable=False), + sa.Column("for_date", sa.Date(), nullable=False), + sa.Column("complete", sa.Boolean(), nullable=True), + sa.PrimaryKeyConstraint("id"), + sa.UniqueConstraint("run_type", "run_datetime", "for_date"), + comment="A combination of run type, run datetime and for date.", + ) + op.create_index( + op.f("ix_run_parameters_for_date"), "run_parameters", ["for_date"], unique=False + ) + op.create_index(op.f("ix_run_parameters_id"), "run_parameters", ["id"], unique=False) + op.create_index( + op.f("ix_run_parameters_run_datetime"), "run_parameters", ["run_datetime"], unique=False + ) + op.create_index( + op.f("ix_run_parameters_run_type"), "run_parameters", ["run_type"], unique=False + ) + op.create_table( + "saved_model_run_for_sfms_urls", + sa.Column("id", sa.Integer(), nullable=False), + sa.Column("url", sa.String(), nullable=False), + sa.Column("s3_key", sa.String(), nullable=False), + sa.Column("create_date", wps_shared.db.models.common.TZTimeStamp(), nullable=False), + sa.Column("update_date", wps_shared.db.models.common.TZTimeStamp(), nullable=False), + sa.PrimaryKeyConstraint("id"), + comment="Record to indicate that a particular RDPS model run file has been downloaded and saved to S3 storage.", + ) + op.create_index( + op.f("ix_saved_model_run_for_sfms_urls_id"), + "saved_model_run_for_sfms_urls", + ["id"], + unique=False, + ) + op.create_index( + op.f("ix_saved_model_run_for_sfms_urls_s3_key"), + "saved_model_run_for_sfms_urls", + ["s3_key"], + unique=True, + ) + op.create_index( + op.f("ix_saved_model_run_for_sfms_urls_url"), + "saved_model_run_for_sfms_urls", + ["url"], + unique=True, + ) + op.create_table( + "sfms_fuel_types", + sa.Column("id", sa.Integer(), nullable=False), + sa.Column("fuel_type_id", sa.Integer(), nullable=False), + sa.Column("fuel_type_code", sa.String(), nullable=False), + sa.Column("description", sa.String(), nullable=True), + sa.PrimaryKeyConstraint("id"), + comment="Fuel types used by SFMS to calculate HFI spatially", + ) + op.create_index( + op.f("ix_sfms_fuel_types_fuel_type_id"), "sfms_fuel_types", ["fuel_type_id"], unique=False + ) + op.create_index(op.f("ix_sfms_fuel_types_id"), "sfms_fuel_types", ["id"], unique=False) + op.create_table( + "advisory_classified_hfi", + sa.Column("id", sa.Integer(), nullable=False), + sa.Column("threshold", sa.Integer(), nullable=False), + sa.Column("run_type", sa.Enum("forecast", "actual", name="runtypeenum"), nullable=False), + sa.Column("run_datetime", wps_shared.db.models.common.TZTimeStamp(), nullable=False), + sa.Column("for_date", sa.Date(), nullable=False), + sa.Column( + "geom", + geoalchemy2.types.Geometry( + geometry_type="POLYGON", + srid=3005, + dimension=2, + spatial_index=False, + from_text="ST_GeomFromEWKT", + name="geometry", + ), + nullable=True, + ), + sa.ForeignKeyConstraint( + ["threshold"], + ["advisory_hfi_classification_threshold.id"], + ), + sa.PrimaryKeyConstraint("id"), + comment="HFI classification for some forecast/advisory run on some day, for some date", + ) + op.create_index( + "idx_advisory_classified_hfi_geom", + "advisory_classified_hfi", + ["geom"], + unique=False, + postgresql_using="gist", + ) + op.create_index( + op.f("ix_advisory_classified_hfi_id"), "advisory_classified_hfi", ["id"], unique=False + ) + op.create_index( + op.f("ix_advisory_classified_hfi_run_type"), + "advisory_classified_hfi", + ["run_type"], + unique=False, + ) + op.create_index( + op.f("ix_advisory_classified_hfi_threshold"), + "advisory_classified_hfi", + ["threshold"], + unique=False, + ) + op.create_table( + "advisory_fuel_types", + sa.Column("id", sa.Integer(), nullable=False), + sa.Column("fuel_type_id", sa.Integer(), nullable=False), + sa.Column( + "geom", + geoalchemy2.types.Geometry( + geometry_type="POLYGON", + srid=3005, + dimension=2, + spatial_index=False, + from_text="ST_GeomFromEWKT", + name="geometry", + ), + nullable=True, + ), + sa.Column("fuel_type_raster_id", sa.Integer(), nullable=True), + sa.ForeignKeyConstraint( + ["fuel_type_raster_id"], + ["fuel_type_raster.id"], + ), + sa.PrimaryKeyConstraint("id"), + comment="Identify some kind of fuel type", + ) + op.create_index( + "idx_advisory_fuel_types_geom", + "advisory_fuel_types", + ["geom"], + unique=False, + postgresql_using="gist", + ) + op.create_index( + op.f("ix_advisory_fuel_types_fuel_type_id"), + "advisory_fuel_types", + ["fuel_type_id"], + unique=False, + ) + op.create_index( + op.f("ix_advisory_fuel_types_fuel_type_raster_id"), + "advisory_fuel_types", + ["fuel_type_raster_id"], + unique=False, + ) + op.create_index(op.f("ix_advisory_fuel_types_id"), "advisory_fuel_types", ["id"], unique=False) + op.create_table( + "advisory_shapes", + sa.Column("id", sa.Integer(), nullable=False), + sa.Column("source_identifier", sa.String(), nullable=False), + sa.Column("shape_type", sa.Integer(), nullable=False), + sa.Column("combustible_area", sa.Float(), nullable=True), + sa.Column( + "geom", + geoalchemy2.types.Geometry( + geometry_type="MULTIPOLYGON", + srid=3005, + dimension=2, + spatial_index=False, + from_text="ST_GeomFromEWKT", + name="geometry", + nullable=False, + ), + nullable=False, + ), + sa.Column("label", sa.String(), nullable=True), + sa.Column("placename_label", sa.String(), nullable=True), + sa.Column("fire_centre", sa.Integer(), nullable=True), + sa.ForeignKeyConstraint( + ["fire_centre"], + ["fire_centres.id"], + ), + sa.ForeignKeyConstraint( + ["shape_type"], + ["advisory_shape_types.id"], + ), + sa.PrimaryKeyConstraint("id"), + sa.UniqueConstraint("source_identifier", "shape_type"), + comment="Record identifying some area of interest with respect to advisories", + ) + op.create_index( + "idx_advisory_shapes_geom", + "advisory_shapes", + ["geom"], + unique=False, + postgresql_using="gist", + ) + op.create_index( + op.f("ix_advisory_shapes_fire_centre"), "advisory_shapes", ["fire_centre"], unique=False + ) + op.create_index( + op.f("ix_advisory_shapes_shape_type"), "advisory_shapes", ["shape_type"], unique=False + ) + op.create_index( + op.f("ix_advisory_shapes_source_identifier"), + "advisory_shapes", + ["source_identifier"], + unique=False, + ) + op.create_table( + "fire_watch", + sa.Column("id", sa.Integer(), nullable=False), + sa.Column( + "burn_location", + geoalchemy2.types.Geometry( + geometry_type="POINT", + srid=3005, + dimension=2, + spatial_index=False, + from_text="ST_GeomFromEWKT", + name="geometry", + nullable=False, + ), + nullable=False, + ), + sa.Column("burn_window_end", wps_shared.db.models.common.TZTimeStamp(), nullable=True), + sa.Column("burn_window_start", wps_shared.db.models.common.TZTimeStamp(), nullable=True), + sa.Column("contact_email", sa.ARRAY(sa.String()), nullable=False), + sa.Column("create_timestamp", wps_shared.db.models.common.TZTimeStamp(), nullable=False), + sa.Column("create_user", sa.String(), nullable=False), + sa.Column("fire_centre", sa.Integer(), nullable=True), + sa.Column("station_code", sa.Integer(), nullable=False), + sa.Column( + "status", + sa.Enum("ACTIVE", "CANCELLED", "COMPLETE", "HOLD", name="burnstatusenum"), + nullable=False, + ), + sa.Column("title", sa.String(), nullable=False), + sa.Column("update_timestamp", wps_shared.db.models.common.TZTimeStamp(), nullable=False), + sa.Column("update_user", sa.String(), nullable=False), + sa.Column( + "fuel_type", + sa.Enum( + "C1", + "C2", + "C3", + "C4", + "C5", + "C6", + "C7", + "C7B", + "D1", + "D2", + "M1", + "M2", + "M3", + "M4", + "O1A", + "O1B", + "S1", + "S2", + "S3", + name="fueltypeenum", + ), + nullable=False, + ), + sa.Column("percent_conifer", sa.Float(), nullable=True), + sa.Column("percent_dead_fir", sa.Float(), nullable=True), + sa.Column("percent_grass_curing", sa.Float(), nullable=True), + sa.Column("temp_min", sa.Float(), nullable=False), + sa.Column("temp_preferred", sa.Float(), nullable=True), + sa.Column("temp_max", sa.Float(), nullable=False), + sa.Column("rh_min", sa.Float(), nullable=False), + sa.Column("rh_preferred", sa.Float(), nullable=True), + sa.Column("rh_max", sa.Float(), nullable=False), + sa.Column("wind_speed_min", sa.Float(), nullable=False), + sa.Column("wind_speed_preferred", sa.Float(), nullable=True), + sa.Column("wind_speed_max", sa.Float(), nullable=False), + sa.Column("ffmc_min", sa.Float(), nullable=True), + sa.Column("ffmc_preferred", sa.Float(), nullable=True), + sa.Column("ffmc_max", sa.Float(), nullable=True), + sa.Column("dmc_min", sa.Float(), nullable=True), + sa.Column("dmc_preferred", sa.Float(), nullable=True), + sa.Column("dmc_max", sa.Float(), nullable=True), + sa.Column("dc_min", sa.Float(), nullable=True), + sa.Column("dc_preferred", sa.Float(), nullable=True), + sa.Column("dc_max", sa.Float(), nullable=True), + sa.Column("isi_min", sa.Float(), nullable=True), + sa.Column("isi_preferred", sa.Float(), nullable=True), + sa.Column("isi_max", sa.Float(), nullable=True), + sa.Column("bui_min", sa.Float(), nullable=True), + sa.Column("bui_preferred", sa.Float(), nullable=True), + sa.Column("bui_max", sa.Float(), nullable=True), + sa.Column("hfi_min", sa.Float(), nullable=False), + sa.Column("hfi_preferred", sa.Float(), nullable=True), + sa.Column("hfi_max", sa.Float(), nullable=False), + sa.ForeignKeyConstraint( + ["fire_centre"], + ["fire_centres.id"], + ), + sa.PrimaryKeyConstraint("id"), + comment="Contains parameters related to a prescribed burn.", + ) + op.create_index( + "idx_fire_watch_burn_location", + "fire_watch", + ["burn_location"], + unique=False, + postgresql_using="gist", + ) + op.create_index(op.f("ix_fire_watch_id"), "fire_watch", ["id"], unique=False) + op.create_index(op.f("ix_fire_watch_status"), "fire_watch", ["status"], unique=False) + op.create_table( + "hfi_fire_centre_fire_start_range", + sa.Column("id", sa.Integer(), nullable=False), + sa.Column("fire_start_range_id", sa.Integer(), nullable=False), + sa.Column("fire_centre_id", sa.Integer(), nullable=False), + sa.Column("order", sa.Integer(), nullable=False), + sa.ForeignKeyConstraint( + ["fire_centre_id"], + ["fire_centres.id"], + ), + sa.ForeignKeyConstraint( + ["fire_start_range_id"], + ["hfi_fire_start_range.id"], + ), + sa.PrimaryKeyConstraint("id"), + sa.UniqueConstraint( + "fire_start_range_id", "fire_centre_id", name="unique_fire_start_range_for_fire_centre" + ), + comment="Link table for fire centre fire start ranges", + ) + op.create_index( + op.f("ix_hfi_fire_centre_fire_start_range_fire_centre_id"), + "hfi_fire_centre_fire_start_range", + ["fire_centre_id"], + unique=False, + ) + op.create_index( + op.f("ix_hfi_fire_centre_fire_start_range_fire_start_range_id"), + "hfi_fire_centre_fire_start_range", + ["fire_start_range_id"], + unique=False, + ) + op.create_table( + "hfi_fire_start_lookup", + sa.Column("id", sa.Integer(), nullable=False), + sa.Column("fire_start_range_id", sa.Integer(), nullable=False), + sa.Column("mean_intensity_group", sa.Integer(), nullable=False), + sa.Column("prep_level", sa.Integer(), nullable=False), + sa.ForeignKeyConstraint( + ["fire_start_range_id"], + ["hfi_fire_start_range.id"], + ), + sa.PrimaryKeyConstraint("id"), + comment="Fire start mean intensity group prep level lookup", + ) + op.create_index( + op.f("ix_hfi_fire_start_lookup_fire_start_range_id"), + "hfi_fire_start_lookup", + ["fire_start_range_id"], + unique=False, + ) + op.create_table( + "hfi_request", + sa.Column("id", sa.Integer(), nullable=False), + sa.Column("fire_centre_id", sa.Integer(), nullable=False), + sa.Column("prep_start_day", sa.Date(), nullable=False), + sa.Column("prep_end_day", sa.Date(), nullable=False), + sa.Column("create_timestamp", wps_shared.db.models.common.TZTimeStamp(), nullable=False), + sa.Column("create_user", sa.String(), nullable=False), + sa.Column("request", sa.JSON(), nullable=True), + sa.ForeignKeyConstraint( + ["fire_centre_id"], + ["fire_centres.id"], + ), + sa.PrimaryKeyConstraint("id"), + sa.UniqueConstraint( + "fire_centre_id", + "prep_start_day", + "prep_end_day", + "create_timestamp", + name="unique_request_create_timestamp_for_fire_centre", + ), + comment="Identifies the unique code used to identify the station", + ) + op.create_index( + op.f("ix_hfi_request_create_timestamp"), "hfi_request", ["create_timestamp"], unique=False + ) + op.create_index( + op.f("ix_hfi_request_fire_centre_id"), "hfi_request", ["fire_centre_id"], unique=False + ) + op.create_index( + op.f("ix_hfi_request_prep_end_day"), "hfi_request", ["prep_end_day"], unique=False + ) + op.create_index( + op.f("ix_hfi_request_prep_start_day"), "hfi_request", ["prep_start_day"], unique=False + ) + op.create_table( + "model_run_for_sfms", + sa.Column("id", sa.Integer(), nullable=False), + sa.Column("prediction_model_id", sa.Integer(), nullable=False), + sa.Column("model_run_timestamp", wps_shared.db.models.common.TZTimeStamp(), nullable=False), + sa.Column("create_date", wps_shared.db.models.common.TZTimeStamp(), nullable=False), + sa.Column("update_date", wps_shared.db.models.common.TZTimeStamp(), nullable=False), + sa.ForeignKeyConstraint( + ["prediction_model_id"], + ["prediction_models.id"], + ), + sa.PrimaryKeyConstraint("id"), + comment="Record to indicate numerical weather model data for SFMS has been downloaded and stored in S3.", + ) + op.create_index(op.f("ix_model_run_for_sfms_id"), "model_run_for_sfms", ["id"], unique=False) + op.create_index( + op.f("ix_model_run_for_sfms_model_run_timestamp"), + "model_run_for_sfms", + ["model_run_timestamp"], + unique=False, + ) + op.create_table( + "planning_areas", + sa.Column("id", sa.Integer(), nullable=False), + sa.Column("name", sa.String(), nullable=False), + sa.Column("fire_centre_id", sa.Integer(), nullable=False), + sa.Column("order_of_appearance_in_list", sa.Integer(), nullable=False), + sa.ForeignKeyConstraint( + ["fire_centre_id"], + ["fire_centres.id"], + ), + sa.PrimaryKeyConstraint("id"), + sa.UniqueConstraint( + "order_of_appearance_in_list", + "fire_centre_id", + name="unique_list_order_for_fire_centre_constraint", + ), + comment="Only one planning area can be assigned a position in the list for a fire centre", + ) + op.create_index( + op.f("ix_planning_areas_fire_centre_id"), "planning_areas", ["fire_centre_id"], unique=False + ) + op.create_index(op.f("ix_planning_areas_id"), "planning_areas", ["id"], unique=False) + op.create_index(op.f("ix_planning_areas_name"), "planning_areas", ["name"], unique=False) + op.create_table( + "prediction_model_grid_subsets", + sa.Column("id", sa.Integer(), nullable=False), + sa.Column("prediction_model_id", sa.Integer(), nullable=False), + sa.Column( + "geom", + geoalchemy2.types.Geometry( + geometry_type="POLYGON", + dimension=2, + spatial_index=False, + from_text="ST_GeomFromEWKT", + name="geometry", + nullable=False, + ), + nullable=False, + ), + sa.ForeignKeyConstraint( + ["prediction_model_id"], + ["prediction_models.id"], + ), + sa.PrimaryKeyConstraint("id"), + sa.UniqueConstraint("prediction_model_id", "geom"), + comment="Identify the vertices surrounding the area of interest", + ) + op.create_index( + "idx_prediction_model_grid_subsets_geom", + "prediction_model_grid_subsets", + ["geom"], + unique=False, + postgresql_using="gist", + ) + op.create_index( + op.f("ix_prediction_model_grid_subsets_id"), + "prediction_model_grid_subsets", + ["id"], + unique=False, + ) + op.create_index( + op.f("ix_prediction_model_grid_subsets_prediction_model_id"), + "prediction_model_grid_subsets", + ["prediction_model_id"], + unique=False, + ) + op.create_table( + "prediction_model_run_timestamps", + sa.Column("id", sa.Integer(), nullable=False), + sa.Column("prediction_model_id", sa.Integer(), nullable=False), + sa.Column( + "prediction_run_timestamp", wps_shared.db.models.common.TZTimeStamp(), nullable=False + ), + sa.Column("complete", sa.Boolean(), nullable=False), + sa.Column("interpolated", sa.Boolean(), nullable=False), + sa.ForeignKeyConstraint( + ["prediction_model_id"], + ["prediction_models.id"], + ), + sa.PrimaryKeyConstraint("id"), + sa.UniqueConstraint("prediction_model_id", "prediction_run_timestamp"), + comment="Identify which prediction model run (e.g. 2020 07 07 12:00).", + ) + op.create_index( + op.f("ix_prediction_model_run_timestamps_id"), + "prediction_model_run_timestamps", + ["id"], + unique=False, + ) + op.create_index( + op.f("ix_prediction_model_run_timestamps_prediction_model_id"), + "prediction_model_run_timestamps", + ["prediction_model_id"], + unique=False, + ) + op.create_index( + op.f("ix_prediction_model_run_timestamps_prediction_run_timestamp"), + "prediction_model_run_timestamps", + ["prediction_run_timestamp"], + unique=False, + ) + op.create_table( + "advisory_elevation_stats", + sa.Column("id", sa.Integer(), nullable=False), + sa.Column("advisory_shape_id", sa.Integer(), nullable=False), + sa.Column("threshold", sa.Integer(), nullable=False), + sa.Column("run_parameters", sa.Integer(), nullable=False), + sa.Column("minimum", sa.Float(), nullable=False), + sa.Column("quartile_25", sa.Float(), nullable=False), + sa.Column("median", sa.Float(), nullable=False), + sa.Column("quartile_75", sa.Float(), nullable=False), + sa.Column("maximum", sa.Float(), nullable=False), + sa.ForeignKeyConstraint( + ["advisory_shape_id"], + ["advisory_shapes.id"], + ), + sa.ForeignKeyConstraint( + ["run_parameters"], + ["run_parameters.id"], + ), + sa.ForeignKeyConstraint( + ["threshold"], + ["advisory_hfi_classification_threshold.id"], + ), + sa.PrimaryKeyConstraint("id"), + comment="Elevation stats per fire shape by advisory threshold", + ) + op.create_index( + op.f("ix_advisory_elevation_stats_advisory_shape_id"), + "advisory_elevation_stats", + ["advisory_shape_id"], + unique=False, + ) + op.create_index( + op.f("ix_advisory_elevation_stats_id"), "advisory_elevation_stats", ["id"], unique=False + ) + op.create_index( + op.f("ix_advisory_elevation_stats_run_parameters"), + "advisory_elevation_stats", + ["run_parameters"], + unique=False, + ) + op.create_table( + "advisory_fuel_stats", + sa.Column("id", sa.Integer(), nullable=False), + sa.Column("advisory_shape_id", sa.Integer(), nullable=False), + sa.Column("threshold", sa.Integer(), nullable=False), + sa.Column("run_parameters", sa.Integer(), nullable=False), + sa.Column("fuel_type", sa.Integer(), nullable=False), + sa.Column("area", sa.Float(), nullable=False), + sa.Column("fuel_type_raster_id", sa.Integer(), nullable=True), + sa.ForeignKeyConstraint( + ["advisory_shape_id"], + ["advisory_shapes.id"], + ), + sa.ForeignKeyConstraint( + ["fuel_type"], + ["sfms_fuel_types.id"], + ), + sa.ForeignKeyConstraint( + ["fuel_type_raster_id"], + ["fuel_type_raster.id"], + ), + sa.ForeignKeyConstraint( + ["run_parameters"], + ["run_parameters.id"], + ), + sa.ForeignKeyConstraint( + ["threshold"], + ["advisory_hfi_classification_threshold.id"], + ), + sa.PrimaryKeyConstraint("id"), + sa.UniqueConstraint("advisory_shape_id", "threshold", "run_parameters", "fuel_type"), + comment="Fuel type stats per fire shape by advisory threshold", + ) + op.create_index( + op.f("ix_advisory_fuel_stats_advisory_shape_id"), + "advisory_fuel_stats", + ["advisory_shape_id"], + unique=False, + ) + op.create_index( + op.f("ix_advisory_fuel_stats_fuel_type"), "advisory_fuel_stats", ["fuel_type"], unique=False + ) + op.create_index( + op.f("ix_advisory_fuel_stats_fuel_type_raster_id"), + "advisory_fuel_stats", + ["fuel_type_raster_id"], + unique=False, + ) + op.create_index(op.f("ix_advisory_fuel_stats_id"), "advisory_fuel_stats", ["id"], unique=False) + op.create_index( + op.f("ix_advisory_fuel_stats_run_parameters"), + "advisory_fuel_stats", + ["run_parameters"], + unique=False, + ) + op.create_table( + "advisory_hfi_percent_conifer", + sa.Column("id", sa.Integer(), nullable=False), + sa.Column("advisory_shape_id", sa.Integer(), nullable=False), + sa.Column("fuel_type", sa.Integer(), nullable=False), + sa.Column("run_parameters", sa.Integer(), nullable=False), + sa.Column("min_percent_conifer", sa.Integer(), nullable=True), + sa.Column("fuel_type_raster_id", sa.Integer(), nullable=True), + sa.ForeignKeyConstraint( + ["advisory_shape_id"], + ["advisory_shapes.id"], + ), + sa.ForeignKeyConstraint( + ["fuel_type"], + ["sfms_fuel_types.id"], + ), + sa.ForeignKeyConstraint( + ["fuel_type_raster_id"], + ["fuel_type_raster.id"], + ), + sa.ForeignKeyConstraint( + ["run_parameters"], + ["run_parameters.id"], + ), + sa.PrimaryKeyConstraint("id"), + comment="Minimum percent conifer for HFI above advisory level, per fire zone. min_percent_conifer refers to the minimum percent of conifer trees in a fire zone that coincides with hfi pixels exceeding an HFI value of 4000.", + ) + op.create_index( + op.f("ix_advisory_hfi_percent_conifer_advisory_shape_id"), + "advisory_hfi_percent_conifer", + ["advisory_shape_id"], + unique=False, + ) + op.create_index( + op.f("ix_advisory_hfi_percent_conifer_fuel_type_raster_id"), + "advisory_hfi_percent_conifer", + ["fuel_type_raster_id"], + unique=False, + ) + op.create_index( + op.f("ix_advisory_hfi_percent_conifer_id"), + "advisory_hfi_percent_conifer", + ["id"], + unique=False, + ) + op.create_index( + op.f("ix_advisory_hfi_percent_conifer_run_parameters"), + "advisory_hfi_percent_conifer", + ["run_parameters"], + unique=False, + ) + op.create_table( + "advisory_hfi_wind_speed", + sa.Column("id", sa.Integer(), nullable=False), + sa.Column("advisory_shape_id", sa.Integer(), nullable=False), + sa.Column("threshold", sa.Integer(), nullable=False), + sa.Column("run_parameters", sa.Integer(), nullable=False), + sa.Column("min_wind_speed", sa.Float(), nullable=True), + sa.ForeignKeyConstraint( + ["advisory_shape_id"], + ["advisory_shapes.id"], + ), + sa.ForeignKeyConstraint( + ["run_parameters"], + ["run_parameters.id"], + ), + sa.ForeignKeyConstraint( + ["threshold"], + ["advisory_hfi_classification_threshold.id"], + ), + sa.PrimaryKeyConstraint("id"), + comment="Minimum wind speed for each HFI class, per fire zone. hfi_wind_speed refers to the minimum wind speed in a fire zone that coincides with hfi pixels meeting or exceeding a certain threshold.", + ) + op.create_index( + op.f("ix_advisory_hfi_wind_speed_advisory_shape_id"), + "advisory_hfi_wind_speed", + ["advisory_shape_id"], + unique=False, + ) + op.create_index( + op.f("ix_advisory_hfi_wind_speed_id"), "advisory_hfi_wind_speed", ["id"], unique=False + ) + op.create_index( + op.f("ix_advisory_hfi_wind_speed_run_parameters"), + "advisory_hfi_wind_speed", + ["run_parameters"], + unique=False, + ) + op.create_index( + op.f("ix_advisory_hfi_wind_speed_threshold"), + "advisory_hfi_wind_speed", + ["threshold"], + unique=False, + ) + op.create_table( + "advisory_shape_fuels", + sa.Column("id", sa.Integer(), nullable=False), + sa.Column("advisory_shape_id", sa.Integer(), nullable=False), + sa.Column("fuel_type", sa.Integer(), nullable=False), + sa.Column("fuel_area", sa.Float(), nullable=False), + sa.Column("fuel_type_raster_id", sa.Integer(), nullable=True), + sa.ForeignKeyConstraint( + ["advisory_shape_id"], + ["advisory_shapes.id"], + ), + sa.ForeignKeyConstraint( + ["fuel_type"], + ["sfms_fuel_types.id"], + ), + sa.ForeignKeyConstraint( + ["fuel_type_raster_id"], + ["fuel_type_raster.id"], + ), + sa.PrimaryKeyConstraint("id"), + comment="Fuel types and their areas in fire zone units.", + ) + op.create_index( + op.f("ix_advisory_shape_fuels_advisory_shape_id"), + "advisory_shape_fuels", + ["advisory_shape_id"], + unique=False, + ) + op.create_index( + op.f("ix_advisory_shape_fuels_fuel_type"), + "advisory_shape_fuels", + ["fuel_type"], + unique=False, + ) + op.create_index( + op.f("ix_advisory_shape_fuels_fuel_type_raster_id"), + "advisory_shape_fuels", + ["fuel_type_raster_id"], + unique=False, + ) + op.create_index( + op.f("ix_advisory_shape_fuels_id"), "advisory_shape_fuels", ["id"], unique=False + ) + op.create_table( + "advisory_tpi_stats", + sa.Column("id", sa.Integer(), nullable=False), + sa.Column("advisory_shape_id", sa.Integer(), nullable=False), + sa.Column("run_parameters", sa.Integer(), nullable=False), + sa.Column("valley_bottom", sa.Integer(), nullable=False), + sa.Column("mid_slope", sa.Integer(), nullable=False), + sa.Column("upper_slope", sa.Integer(), nullable=False), + sa.Column("pixel_size_metres", sa.Integer(), nullable=False), + sa.ForeignKeyConstraint( + ["advisory_shape_id"], + ["advisory_shapes.id"], + ), + sa.ForeignKeyConstraint( + ["run_parameters"], + ["run_parameters.id"], + ), + sa.PrimaryKeyConstraint("id"), + comment="Elevation TPI stats per fire shape", + ) + op.create_index( + op.f("ix_advisory_tpi_stats_advisory_shape_id"), + "advisory_tpi_stats", + ["advisory_shape_id"], + unique=False, + ) + op.create_index(op.f("ix_advisory_tpi_stats_id"), "advisory_tpi_stats", ["id"], unique=False) + op.create_index( + op.f("ix_advisory_tpi_stats_run_parameters"), + "advisory_tpi_stats", + ["run_parameters"], + unique=False, + ) + op.create_table( + "advisory_zone_status", + sa.Column("id", sa.Integer(), nullable=False), + sa.Column("run_parameters", sa.Integer(), nullable=False), + sa.Column("advisory_shape_id", sa.Integer(), nullable=False), + sa.Column("advisory_percentage", sa.Float(), nullable=True), + sa.Column("warning_percentage", sa.Float(), nullable=True), + sa.Column("fuel_type_raster_id", sa.Integer(), nullable=False), + sa.ForeignKeyConstraint( + ["advisory_shape_id"], + ["advisory_shapes.id"], + ), + sa.ForeignKeyConstraint( + ["fuel_type_raster_id"], + ["fuel_type_raster.id"], + ), + sa.ForeignKeyConstraint( + ["run_parameters"], + ["run_parameters.id"], + ), + sa.PrimaryKeyConstraint("id"), + sa.UniqueConstraint("run_parameters", "advisory_shape_id", "fuel_type_raster_id"), + comment="Status of zones (advisory/warning) for a given run parameter.", + ) + op.create_index( + op.f("ix_advisory_zone_status_advisory_shape_id"), + "advisory_zone_status", + ["advisory_shape_id"], + unique=False, + ) + op.create_index( + op.f("ix_advisory_zone_status_fuel_type_raster_id"), + "advisory_zone_status", + ["fuel_type_raster_id"], + unique=False, + ) + op.create_index( + op.f("ix_advisory_zone_status_id"), "advisory_zone_status", ["id"], unique=False + ) + op.create_index( + op.f("ix_advisory_zone_status_run_parameters"), + "advisory_zone_status", + ["run_parameters"], + unique=False, + ) + op.create_table( + "combustible_area", + sa.Column("id", sa.Integer(), nullable=False), + sa.Column("advisory_shape_id", sa.Integer(), nullable=False), + sa.Column("combustible_area", sa.Float(), nullable=False), + sa.Column("fuel_type_raster_id", sa.Integer(), nullable=False), + sa.ForeignKeyConstraint( + ["advisory_shape_id"], + ["advisory_shapes.id"], + ), + sa.ForeignKeyConstraint( + ["fuel_type_raster_id"], + ["fuel_type_raster.id"], + ), + sa.PrimaryKeyConstraint("id"), + comment="The combustible area of advisory shapes for each unique fuel grid.", + ) + op.create_index( + op.f("ix_combustible_area_advisory_shape_id"), + "combustible_area", + ["advisory_shape_id"], + unique=False, + ) + op.create_index( + op.f("ix_combustible_area_fuel_type_raster_id"), + "combustible_area", + ["fuel_type_raster_id"], + unique=False, + ) + op.create_index(op.f("ix_combustible_area_id"), "combustible_area", ["id"], unique=False) + op.create_table( + "critical_hours", + sa.Column("id", sa.Integer(), nullable=False), + sa.Column("advisory_shape_id", sa.Integer(), nullable=False), + sa.Column( + "threshold", + postgresql.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.Column("fuel_type_raster_id", sa.Integer(), nullable=True), + sa.ForeignKeyConstraint( + ["advisory_shape_id"], + ["advisory_shapes.id"], + ), + sa.ForeignKeyConstraint( + ["fuel_type"], + ["sfms_fuel_types.id"], + ), + sa.ForeignKeyConstraint( + ["fuel_type_raster_id"], + ["fuel_type_raster.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_fuel_type_raster_id"), + "critical_hours", + ["fuel_type_raster_id"], + 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 + ) + op.create_table( + "fire_watch_weather", + sa.Column("id", sa.Integer(), nullable=False), + sa.Column("fire_watch_id", sa.Integer(), nullable=False), + sa.Column("date", sa.Date(), nullable=False), + sa.Column("prediction_model_run_timestamp_id", sa.Integer(), nullable=False), + sa.Column("temperature", sa.Float(), nullable=False), + sa.Column("relative_humidity", sa.Float(), nullable=False), + sa.Column("wind_speed", sa.Float(), nullable=False), + sa.Column("precip_24hr", sa.Float(), nullable=False), + sa.Column("ffmc", sa.Float(), nullable=False), + sa.Column("dmc", sa.Float(), nullable=False), + sa.Column("dc", sa.Float(), nullable=False), + sa.Column("isi", sa.Float(), nullable=False), + sa.Column("bui", sa.Float(), nullable=False), + sa.Column("hfi", sa.Float(), nullable=False), + sa.Column("in_prescription", sa.Integer(), nullable=False), + sa.Column("created_at", wps_shared.db.models.common.TZTimeStamp(), nullable=False), + sa.ForeignKeyConstraint( + ["fire_watch_id"], + ["fire_watch.id"], + ), + sa.ForeignKeyConstraint( + ["in_prescription"], + ["prescription_status.id"], + ), + sa.ForeignKeyConstraint( + ["prediction_model_run_timestamp_id"], + ["prediction_model_run_timestamps.id"], + ), + sa.PrimaryKeyConstraint("id"), + comment="Contains weather forecasts and FWI/FBP indices related to a fire watch prescribed burn.", + ) + op.create_index( + op.f("ix_fire_watch_weather_date"), "fire_watch_weather", ["date"], unique=False + ) + op.create_index( + op.f("ix_fire_watch_weather_fire_watch_id"), + "fire_watch_weather", + ["fire_watch_id"], + unique=False, + ) + op.create_index(op.f("ix_fire_watch_weather_id"), "fire_watch_weather", ["id"], unique=False) + op.create_index( + op.f("ix_fire_watch_weather_in_prescription"), + "fire_watch_weather", + ["in_prescription"], + unique=False, + ) + op.create_index( + op.f("ix_fire_watch_weather_prediction_model_run_timestamp_id"), + "fire_watch_weather", + ["prediction_model_run_timestamp_id"], + unique=False, + ) + op.create_table( + "hfi_ready", + sa.Column("id", sa.UUID(), nullable=False), + sa.Column("hfi_request_id", sa.Integer(), nullable=False), + sa.Column("planning_area_id", sa.Integer(), nullable=False), + sa.Column("ready", sa.Boolean(), nullable=False), + sa.Column("create_timestamp", wps_shared.db.models.common.TZTimeStamp(), nullable=False), + sa.Column("create_user", sa.String(), nullable=False), + sa.Column("update_timestamp", wps_shared.db.models.common.TZTimeStamp(), nullable=False), + sa.Column("update_user", sa.String(), nullable=False), + sa.ForeignKeyConstraint( + ["hfi_request_id"], + ["hfi_request.id"], + ), + sa.ForeignKeyConstraint( + ["planning_area_id"], + ["planning_areas.id"], + ), + sa.PrimaryKeyConstraint("id"), + comment="Marks whether a planning area is ready for a particular HFI Request", + ) + op.create_index( + op.f("ix_hfi_ready_create_timestamp"), "hfi_ready", ["create_timestamp"], unique=False + ) + op.create_index( + op.f("ix_hfi_ready_hfi_request_id"), "hfi_ready", ["hfi_request_id"], unique=False + ) + op.create_index( + op.f("ix_hfi_ready_planning_area_id"), "hfi_ready", ["planning_area_id"], unique=False + ) + op.create_index(op.f("ix_hfi_ready_ready"), "hfi_ready", ["ready"], unique=False) + op.create_index( + op.f("ix_hfi_ready_update_timestamp"), "hfi_ready", ["update_timestamp"], unique=False + ) + op.create_table( + "high_hfi_area", + sa.Column("id", sa.Integer(), nullable=False), + sa.Column("advisory_shape_id", sa.Integer(), nullable=False), + sa.Column("threshold", sa.Integer(), nullable=False), + sa.Column("run_parameters", sa.Integer(), nullable=False), + sa.Column("area", sa.Float(), nullable=False), + sa.ForeignKeyConstraint( + ["advisory_shape_id"], + ["advisory_shapes.id"], + ), + sa.ForeignKeyConstraint( + ["run_parameters"], + ["run_parameters.id"], + ), + sa.ForeignKeyConstraint( + ["threshold"], + ["advisory_hfi_classification_threshold.id"], + ), + sa.PrimaryKeyConstraint("id"), + comment="Area under advisory/warning per fire zone. advisory_area refers to the total area in a fire zone with HFI values between 4000 - 10000 and warn_area refers to the total area in a fire zone with HFI values exceeding 10000.", + ) + op.create_index(op.f("ix_high_hfi_area_id"), "high_hfi_area", ["id"], unique=False) + op.create_index( + op.f("ix_high_hfi_area_run_parameters"), "high_hfi_area", ["run_parameters"], unique=False + ) + op.create_table( + "model_run_grid_subset_predictions", + sa.Column("id", sa.Integer(), nullable=False), + sa.Column("prediction_model_run_timestamp_id", sa.Integer(), nullable=False), + sa.Column("prediction_model_grid_subset_id", sa.Integer(), nullable=False), + sa.Column( + "prediction_timestamp", wps_shared.db.models.common.TZTimeStamp(), nullable=False + ), + sa.Column("tmp_tgl_2", postgresql.ARRAY(sa.Float()), nullable=True), + sa.Column("rh_tgl_2", postgresql.ARRAY(sa.Float()), nullable=True), + sa.Column("apcp_sfc_0", postgresql.ARRAY(sa.Float()), nullable=True), + sa.Column("wdir_tgl_10", postgresql.ARRAY(sa.Float()), nullable=True), + sa.Column("wind_tgl_10", postgresql.ARRAY(sa.Float()), nullable=True), + sa.ForeignKeyConstraint( + ["prediction_model_grid_subset_id"], + ["prediction_model_grid_subsets.id"], + ), + sa.ForeignKeyConstraint( + ["prediction_model_run_timestamp_id"], + ["prediction_model_run_timestamps.id"], + ), + sa.PrimaryKeyConstraint("id"), + sa.UniqueConstraint( + "prediction_model_run_timestamp_id", + "prediction_model_grid_subset_id", + "prediction_timestamp", + ), + comment="The prediction for a grid subset of a particular model run.", + ) + op.create_index( + op.f("ix_model_run_grid_subset_predictions_id"), + "model_run_grid_subset_predictions", + ["id"], + unique=False, + ) + op.create_index( + op.f("ix_model_run_grid_subset_predictions_prediction_model_grid_subset_id"), + "model_run_grid_subset_predictions", + ["prediction_model_grid_subset_id"], + unique=False, + ) + op.create_index( + op.f("ix_model_run_grid_subset_predictions_prediction_model_run_timestamp_id"), + "model_run_grid_subset_predictions", + ["prediction_model_run_timestamp_id"], + unique=False, + ) + op.create_index( + op.f("ix_model_run_grid_subset_predictions_prediction_timestamp"), + "model_run_grid_subset_predictions", + ["prediction_timestamp"], + unique=False, + ) + op.create_table( + "model_run_predictions", + sa.Column("id", sa.Integer(), nullable=False), + sa.Column("prediction_model_run_timestamp_id", sa.Integer(), nullable=False), + sa.Column( + "prediction_timestamp", wps_shared.db.models.common.TZTimeStamp(), nullable=False + ), + sa.Column("station_code", sa.Integer(), nullable=False), + sa.Column("tmp_tgl_2", sa.Float(), nullable=True), + sa.Column("rh_tgl_2", sa.Float(), nullable=True), + sa.Column("apcp_sfc_0", sa.Float(), nullable=True), + sa.Column("wdir_tgl_10", sa.Float(), nullable=True), + sa.Column("wind_tgl_10", sa.Float(), nullable=True), + sa.ForeignKeyConstraint( + ["prediction_model_run_timestamp_id"], + ["prediction_model_run_timestamps.id"], + ), + sa.PrimaryKeyConstraint("id"), + sa.UniqueConstraint( + "prediction_model_run_timestamp_id", "prediction_timestamp", "station_code" + ), + comment="The prediction values of a particular model run.", + ) + op.create_index( + op.f("ix_model_run_predictions_id"), "model_run_predictions", ["id"], unique=False + ) + op.create_index( + op.f("ix_model_run_predictions_prediction_model_run_timestamp_id"), + "model_run_predictions", + ["prediction_model_run_timestamp_id"], + unique=False, + ) + op.create_index( + op.f("ix_model_run_predictions_prediction_timestamp"), + "model_run_predictions", + ["prediction_timestamp"], + unique=False, + ) + op.create_table( + "planning_weather_stations", + sa.Column("id", sa.Integer(), nullable=False), + sa.Column("station_code", sa.Integer(), nullable=False), + sa.Column("fuel_type_id", sa.Integer(), nullable=False), + sa.Column("planning_area_id", sa.Integer(), nullable=False), + sa.Column("order_of_appearance_in_planning_area_list", sa.Integer(), nullable=True), + sa.Column("create_user", sa.String(), nullable=False), + sa.Column("create_timestamp", wps_shared.db.models.common.TZTimeStamp(), nullable=False), + sa.Column("update_user", sa.String(), nullable=False), + sa.Column("update_timestamp", wps_shared.db.models.common.TZTimeStamp(), nullable=False), + sa.Column("is_deleted", sa.Boolean(), nullable=False), + sa.ForeignKeyConstraint( + ["fuel_type_id"], + ["fuel_types.id"], + ), + sa.ForeignKeyConstraint( + ["planning_area_id"], + ["planning_areas.id"], + ), + sa.PrimaryKeyConstraint("id"), + sa.UniqueConstraint( + "order_of_appearance_in_planning_area_list", + "planning_area_id", + name="unique_order_for_planning_area", + ), + comment="Identifies the unique code used to identify the station", + ) + op.create_index( + op.f("ix_planning_weather_stations_fuel_type_id"), + "planning_weather_stations", + ["fuel_type_id"], + unique=False, + ) + op.create_index( + op.f("ix_planning_weather_stations_is_deleted"), + "planning_weather_stations", + ["is_deleted"], + unique=False, + ) + op.create_index( + op.f("ix_planning_weather_stations_planning_area_id"), + "planning_weather_stations", + ["planning_area_id"], + unique=False, + ) + op.create_index( + op.f("ix_planning_weather_stations_station_code"), + "planning_weather_stations", + ["station_code"], + unique=False, + ) + op.create_index( + "unique_non_deleted_station_per_planning_area", + "planning_weather_stations", + ["is_deleted", "station_code", "planning_area_id"], + unique=True, + postgresql_where="not is_deleted", + ) + op.create_table( + "tpi_fuel_area", + sa.Column("id", sa.Integer(), nullable=False), + sa.Column("advisory_shape_id", sa.Integer(), nullable=False), + sa.Column( + "tpi_class", + sa.Enum("valley_bottom", "mid_slope", "upper_slope", name="tpiclassenum"), + nullable=False, + ), + sa.Column("fuel_area", sa.Float(), nullable=False), + sa.Column("fuel_type_raster_id", sa.Integer(), nullable=True), + sa.ForeignKeyConstraint( + ["advisory_shape_id"], + ["advisory_shapes.id"], + ), + sa.ForeignKeyConstraint( + ["fuel_type_raster_id"], + ["fuel_type_raster.id"], + ), + sa.PrimaryKeyConstraint("id"), + comment="Combustible area in each TPI class per fire zone unit.", + ) + op.create_index( + op.f("ix_tpi_fuel_area_advisory_shape_id"), + "tpi_fuel_area", + ["advisory_shape_id"], + unique=False, + ) + op.create_index( + op.f("ix_tpi_fuel_area_fuel_type_raster_id"), + "tpi_fuel_area", + ["fuel_type_raster_id"], + unique=False, + ) + op.create_index(op.f("ix_tpi_fuel_area_id"), "tpi_fuel_area", ["id"], unique=False) + # Create partitioned table for weather_station_model_predictions + op.execute(""" + CREATE TABLE weather_station_model_predictions ( + id INTEGER NOT NULL, + station_code INTEGER NOT NULL, + prediction_model_run_timestamp_id INTEGER NOT NULL, + prediction_timestamp TIMESTAMP WITH TIME ZONE NOT NULL, + tmp_tgl_2 DOUBLE PRECISION, + bias_adjusted_temperature DOUBLE PRECISION, + rh_tgl_2 DOUBLE PRECISION, + bias_adjusted_rh DOUBLE PRECISION, + apcp_sfc_0 DOUBLE PRECISION, + delta_precip DOUBLE PRECISION, + wdir_tgl_10 DOUBLE PRECISION, + bias_adjusted_wdir DOUBLE PRECISION, + wind_tgl_10 DOUBLE PRECISION, + bias_adjusted_wind_speed DOUBLE PRECISION, + create_date TIMESTAMP WITH TIME ZONE NOT NULL, + update_date TIMESTAMP WITH TIME ZONE NOT NULL, + precip_24h DOUBLE PRECISION, + bias_adjusted_precip_24h DOUBLE PRECISION, + PRIMARY KEY (id, prediction_timestamp), + FOREIGN KEY (prediction_model_run_timestamp_id) REFERENCES prediction_model_run_timestamps(id), + UNIQUE (station_code, prediction_model_run_timestamp_id, prediction_timestamp) + ) PARTITION BY RANGE (prediction_timestamp); + """) + + op.execute(""" + COMMENT ON TABLE weather_station_model_predictions IS + 'The interpolated weather values for a weather station, weather date, and model run'; + """) + + # Note: Specific partitions are not created here - they should be managed + # by the application or created in separate migrations as needed + + # Create indexes (these apply to all partitions automatically) + op.create_index( + op.f("ix_weather_station_model_predictions_id"), + "weather_station_model_predictions", + ["id"], + unique=False, + ) + op.create_index( + op.f("ix_weather_station_model_predictions_prediction_model_run_timestamp_id"), + "weather_station_model_predictions", + ["prediction_model_run_timestamp_id"], + unique=False, + ) + op.create_index( + op.f("ix_weather_station_model_predictions_prediction_timestamp"), + "weather_station_model_predictions", + ["prediction_timestamp"], + unique=False, + ) + op.create_index( + op.f("ix_weather_station_model_predictions_station_code"), + "weather_station_model_predictions", + ["station_code"], + unique=False, + ) + op.create_index( + op.f("ix_weather_station_model_predictions_update_date"), + "weather_station_model_predictions", + ["update_date"], + unique=False, + ) + # NOTE: spatial_ref_sys is created and managed by PostGIS extension, don't drop it + # ### end Alembic commands ### + + +def downgrade(): + # ### commands auto generated by Alembic - please adjust! ### + # NOTE: spatial_ref_sys is managed by PostGIS extension, don't recreate it + op.drop_index( + op.f("ix_weather_station_model_predictions_update_date"), + table_name="weather_station_model_predictions", + ) + op.drop_index( + op.f("ix_weather_station_model_predictions_station_code"), + table_name="weather_station_model_predictions", + ) + op.drop_index( + op.f("ix_weather_station_model_predictions_prediction_timestamp"), + table_name="weather_station_model_predictions", + ) + op.drop_index( + op.f("ix_weather_station_model_predictions_prediction_model_run_timestamp_id"), + table_name="weather_station_model_predictions", + ) + op.drop_index( + op.f("ix_weather_station_model_predictions_id"), + table_name="weather_station_model_predictions", + ) + op.drop_table("weather_station_model_predictions") + op.drop_index(op.f("ix_tpi_fuel_area_id"), table_name="tpi_fuel_area") + op.drop_index(op.f("ix_tpi_fuel_area_fuel_type_raster_id"), table_name="tpi_fuel_area") + op.drop_index(op.f("ix_tpi_fuel_area_advisory_shape_id"), table_name="tpi_fuel_area") + op.drop_table("tpi_fuel_area") + op.drop_index( + "unique_non_deleted_station_per_planning_area", + table_name="planning_weather_stations", + postgresql_where="not is_deleted", + ) + op.drop_index( + op.f("ix_planning_weather_stations_station_code"), table_name="planning_weather_stations" + ) + op.drop_index( + op.f("ix_planning_weather_stations_planning_area_id"), + table_name="planning_weather_stations", + ) + op.drop_index( + op.f("ix_planning_weather_stations_is_deleted"), table_name="planning_weather_stations" + ) + op.drop_index( + op.f("ix_planning_weather_stations_fuel_type_id"), table_name="planning_weather_stations" + ) + op.drop_table("planning_weather_stations") + op.drop_index( + op.f("ix_model_run_predictions_prediction_timestamp"), table_name="model_run_predictions" + ) + op.drop_index( + op.f("ix_model_run_predictions_prediction_model_run_timestamp_id"), + table_name="model_run_predictions", + ) + op.drop_index(op.f("ix_model_run_predictions_id"), table_name="model_run_predictions") + op.drop_table("model_run_predictions") + op.drop_index( + op.f("ix_model_run_grid_subset_predictions_prediction_timestamp"), + table_name="model_run_grid_subset_predictions", + ) + op.drop_index( + op.f("ix_model_run_grid_subset_predictions_prediction_model_run_timestamp_id"), + table_name="model_run_grid_subset_predictions", + ) + op.drop_index( + op.f("ix_model_run_grid_subset_predictions_prediction_model_grid_subset_id"), + table_name="model_run_grid_subset_predictions", + ) + op.drop_index( + op.f("ix_model_run_grid_subset_predictions_id"), + table_name="model_run_grid_subset_predictions", + ) + op.drop_table("model_run_grid_subset_predictions") + op.drop_index(op.f("ix_high_hfi_area_run_parameters"), table_name="high_hfi_area") + op.drop_index(op.f("ix_high_hfi_area_id"), table_name="high_hfi_area") + op.drop_table("high_hfi_area") + op.drop_index(op.f("ix_hfi_ready_update_timestamp"), table_name="hfi_ready") + op.drop_index(op.f("ix_hfi_ready_ready"), table_name="hfi_ready") + op.drop_index(op.f("ix_hfi_ready_planning_area_id"), table_name="hfi_ready") + op.drop_index(op.f("ix_hfi_ready_hfi_request_id"), table_name="hfi_ready") + op.drop_index(op.f("ix_hfi_ready_create_timestamp"), table_name="hfi_ready") + op.drop_table("hfi_ready") + op.drop_index( + op.f("ix_fire_watch_weather_prediction_model_run_timestamp_id"), + table_name="fire_watch_weather", + ) + op.drop_index(op.f("ix_fire_watch_weather_in_prescription"), table_name="fire_watch_weather") + op.drop_index(op.f("ix_fire_watch_weather_id"), table_name="fire_watch_weather") + op.drop_index(op.f("ix_fire_watch_weather_fire_watch_id"), table_name="fire_watch_weather") + op.drop_index(op.f("ix_fire_watch_weather_date"), table_name="fire_watch_weather") + op.drop_table("fire_watch_weather") + 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_raster_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") + op.drop_index(op.f("ix_combustible_area_id"), table_name="combustible_area") + op.drop_index(op.f("ix_combustible_area_fuel_type_raster_id"), table_name="combustible_area") + op.drop_index(op.f("ix_combustible_area_advisory_shape_id"), table_name="combustible_area") + op.drop_table("combustible_area") + op.drop_index(op.f("ix_advisory_zone_status_run_parameters"), table_name="advisory_zone_status") + op.drop_index(op.f("ix_advisory_zone_status_id"), table_name="advisory_zone_status") + op.drop_index( + op.f("ix_advisory_zone_status_fuel_type_raster_id"), table_name="advisory_zone_status" + ) + op.drop_index( + op.f("ix_advisory_zone_status_advisory_shape_id"), table_name="advisory_zone_status" + ) + op.drop_table("advisory_zone_status") + op.drop_index(op.f("ix_advisory_tpi_stats_run_parameters"), table_name="advisory_tpi_stats") + op.drop_index(op.f("ix_advisory_tpi_stats_id"), table_name="advisory_tpi_stats") + op.drop_index(op.f("ix_advisory_tpi_stats_advisory_shape_id"), table_name="advisory_tpi_stats") + op.drop_table("advisory_tpi_stats") + op.drop_index(op.f("ix_advisory_shape_fuels_id"), table_name="advisory_shape_fuels") + op.drop_index( + op.f("ix_advisory_shape_fuels_fuel_type_raster_id"), table_name="advisory_shape_fuels" + ) + op.drop_index(op.f("ix_advisory_shape_fuels_fuel_type"), table_name="advisory_shape_fuels") + op.drop_index( + op.f("ix_advisory_shape_fuels_advisory_shape_id"), table_name="advisory_shape_fuels" + ) + op.drop_table("advisory_shape_fuels") + op.drop_index( + op.f("ix_advisory_hfi_wind_speed_threshold"), table_name="advisory_hfi_wind_speed" + ) + op.drop_index( + op.f("ix_advisory_hfi_wind_speed_run_parameters"), table_name="advisory_hfi_wind_speed" + ) + op.drop_index(op.f("ix_advisory_hfi_wind_speed_id"), table_name="advisory_hfi_wind_speed") + op.drop_index( + op.f("ix_advisory_hfi_wind_speed_advisory_shape_id"), table_name="advisory_hfi_wind_speed" + ) + op.drop_table("advisory_hfi_wind_speed") + op.drop_index( + op.f("ix_advisory_hfi_percent_conifer_run_parameters"), + table_name="advisory_hfi_percent_conifer", + ) + op.drop_index( + op.f("ix_advisory_hfi_percent_conifer_id"), table_name="advisory_hfi_percent_conifer" + ) + op.drop_index( + op.f("ix_advisory_hfi_percent_conifer_fuel_type_raster_id"), + table_name="advisory_hfi_percent_conifer", + ) + op.drop_index( + op.f("ix_advisory_hfi_percent_conifer_advisory_shape_id"), + table_name="advisory_hfi_percent_conifer", + ) + op.drop_table("advisory_hfi_percent_conifer") + op.drop_index(op.f("ix_advisory_fuel_stats_run_parameters"), table_name="advisory_fuel_stats") + op.drop_index(op.f("ix_advisory_fuel_stats_id"), table_name="advisory_fuel_stats") + op.drop_index( + op.f("ix_advisory_fuel_stats_fuel_type_raster_id"), table_name="advisory_fuel_stats" + ) + op.drop_index(op.f("ix_advisory_fuel_stats_fuel_type"), table_name="advisory_fuel_stats") + op.drop_index( + op.f("ix_advisory_fuel_stats_advisory_shape_id"), table_name="advisory_fuel_stats" + ) + op.drop_table("advisory_fuel_stats") + op.drop_index( + op.f("ix_advisory_elevation_stats_run_parameters"), table_name="advisory_elevation_stats" + ) + op.drop_index(op.f("ix_advisory_elevation_stats_id"), table_name="advisory_elevation_stats") + op.drop_index( + op.f("ix_advisory_elevation_stats_advisory_shape_id"), table_name="advisory_elevation_stats" + ) + op.drop_table("advisory_elevation_stats") + op.drop_index( + op.f("ix_prediction_model_run_timestamps_prediction_run_timestamp"), + table_name="prediction_model_run_timestamps", + ) + op.drop_index( + op.f("ix_prediction_model_run_timestamps_prediction_model_id"), + table_name="prediction_model_run_timestamps", + ) + op.drop_index( + op.f("ix_prediction_model_run_timestamps_id"), table_name="prediction_model_run_timestamps" + ) + op.drop_table("prediction_model_run_timestamps") + op.drop_index( + op.f("ix_prediction_model_grid_subsets_prediction_model_id"), + table_name="prediction_model_grid_subsets", + ) + op.drop_index( + op.f("ix_prediction_model_grid_subsets_id"), table_name="prediction_model_grid_subsets" + ) + op.drop_index( + "idx_prediction_model_grid_subsets_geom", + table_name="prediction_model_grid_subsets", + postgresql_using="gist", + ) + op.drop_table("prediction_model_grid_subsets") + op.drop_index(op.f("ix_planning_areas_name"), table_name="planning_areas") + op.drop_index(op.f("ix_planning_areas_id"), table_name="planning_areas") + op.drop_index(op.f("ix_planning_areas_fire_centre_id"), table_name="planning_areas") + op.drop_table("planning_areas") + op.drop_index( + op.f("ix_model_run_for_sfms_model_run_timestamp"), table_name="model_run_for_sfms" + ) + op.drop_index(op.f("ix_model_run_for_sfms_id"), table_name="model_run_for_sfms") + op.drop_table("model_run_for_sfms") + op.drop_index(op.f("ix_hfi_request_prep_start_day"), table_name="hfi_request") + op.drop_index(op.f("ix_hfi_request_prep_end_day"), table_name="hfi_request") + op.drop_index(op.f("ix_hfi_request_fire_centre_id"), table_name="hfi_request") + op.drop_index(op.f("ix_hfi_request_create_timestamp"), table_name="hfi_request") + op.drop_table("hfi_request") + op.drop_index( + op.f("ix_hfi_fire_start_lookup_fire_start_range_id"), table_name="hfi_fire_start_lookup" + ) + op.drop_table("hfi_fire_start_lookup") + op.drop_index( + op.f("ix_hfi_fire_centre_fire_start_range_fire_start_range_id"), + table_name="hfi_fire_centre_fire_start_range", + ) + op.drop_index( + op.f("ix_hfi_fire_centre_fire_start_range_fire_centre_id"), + table_name="hfi_fire_centre_fire_start_range", + ) + op.drop_table("hfi_fire_centre_fire_start_range") + op.drop_index(op.f("ix_fire_watch_status"), table_name="fire_watch") + op.drop_index(op.f("ix_fire_watch_id"), table_name="fire_watch") + op.drop_index("idx_fire_watch_burn_location", table_name="fire_watch", postgresql_using="gist") + op.drop_table("fire_watch") + op.drop_index(op.f("ix_advisory_shapes_source_identifier"), table_name="advisory_shapes") + op.drop_index(op.f("ix_advisory_shapes_shape_type"), table_name="advisory_shapes") + op.drop_index(op.f("ix_advisory_shapes_fire_centre"), table_name="advisory_shapes") + op.drop_index("idx_advisory_shapes_geom", table_name="advisory_shapes", postgresql_using="gist") + op.drop_table("advisory_shapes") + op.drop_index(op.f("ix_advisory_fuel_types_id"), table_name="advisory_fuel_types") + op.drop_index( + op.f("ix_advisory_fuel_types_fuel_type_raster_id"), table_name="advisory_fuel_types" + ) + op.drop_index(op.f("ix_advisory_fuel_types_fuel_type_id"), table_name="advisory_fuel_types") + op.drop_index( + "idx_advisory_fuel_types_geom", table_name="advisory_fuel_types", postgresql_using="gist" + ) + op.drop_table("advisory_fuel_types") + op.drop_index( + op.f("ix_advisory_classified_hfi_threshold"), table_name="advisory_classified_hfi" + ) + op.drop_index(op.f("ix_advisory_classified_hfi_run_type"), table_name="advisory_classified_hfi") + op.drop_index(op.f("ix_advisory_classified_hfi_id"), table_name="advisory_classified_hfi") + op.drop_index( + "idx_advisory_classified_hfi_geom", + table_name="advisory_classified_hfi", + postgresql_using="gist", + ) + op.drop_table("advisory_classified_hfi") + op.drop_index(op.f("ix_sfms_fuel_types_id"), table_name="sfms_fuel_types") + op.drop_index(op.f("ix_sfms_fuel_types_fuel_type_id"), table_name="sfms_fuel_types") + op.drop_table("sfms_fuel_types") + op.drop_index( + op.f("ix_saved_model_run_for_sfms_urls_url"), table_name="saved_model_run_for_sfms_urls" + ) + op.drop_index( + op.f("ix_saved_model_run_for_sfms_urls_s3_key"), table_name="saved_model_run_for_sfms_urls" + ) + op.drop_index( + op.f("ix_saved_model_run_for_sfms_urls_id"), table_name="saved_model_run_for_sfms_urls" + ) + op.drop_table("saved_model_run_for_sfms_urls") + op.drop_index(op.f("ix_run_parameters_run_type"), table_name="run_parameters") + op.drop_index(op.f("ix_run_parameters_run_datetime"), table_name="run_parameters") + op.drop_index(op.f("ix_run_parameters_id"), table_name="run_parameters") + op.drop_index(op.f("ix_run_parameters_for_date"), table_name="run_parameters") + op.drop_table("run_parameters") + op.drop_index(op.f("ix_processed_snow_snow_source"), table_name="processed_snow") + op.drop_index(op.f("ix_processed_snow_processed_date"), table_name="processed_snow") + op.drop_index(op.f("ix_processed_snow_id"), table_name="processed_snow") + op.drop_index(op.f("ix_processed_snow_for_date"), table_name="processed_snow") + op.drop_table("processed_snow") + op.drop_index(op.f("ix_processed_model_run_urls_url"), table_name="processed_model_run_urls") + op.drop_index(op.f("ix_processed_model_run_urls_id"), table_name="processed_model_run_urls") + op.drop_table("processed_model_run_urls") + op.drop_index(op.f("ix_prescription_status_id"), table_name="prescription_status") + op.drop_table("prescription_status") + op.drop_index(op.f("ix_prediction_models_id"), table_name="prediction_models") + op.drop_index(op.f("ix_prediction_models_abbreviation"), table_name="prediction_models") + op.drop_table("prediction_models") + op.drop_index(op.f("ix_percent_grass_curing_station_code"), table_name="percent_grass_curing") + op.drop_index(op.f("ix_percent_grass_curing_id"), table_name="percent_grass_curing") + op.drop_index(op.f("ix_percent_grass_curing_for_date"), table_name="percent_grass_curing") + op.drop_table("percent_grass_curing") + op.drop_index(op.f("ix_noon_forecasts_wfwx_update_date"), table_name="noon_forecasts") + op.drop_index(op.f("ix_noon_forecasts_weather_date"), table_name="noon_forecasts") + op.drop_index(op.f("ix_noon_forecasts_station_code"), table_name="noon_forecasts") + op.drop_index(op.f("ix_noon_forecasts_created_at"), table_name="noon_forecasts") + op.drop_table("noon_forecasts") + op.drop_index(op.f("ix_morecast_forecast_wind_speed"), table_name="morecast_forecast") + op.drop_index(op.f("ix_morecast_forecast_wind_direction"), table_name="morecast_forecast") + op.drop_index(op.f("ix_morecast_forecast_update_timestamp"), table_name="morecast_forecast") + op.drop_index(op.f("ix_morecast_forecast_temp"), table_name="morecast_forecast") + op.drop_index(op.f("ix_morecast_forecast_station_code"), table_name="morecast_forecast") + op.drop_index(op.f("ix_morecast_forecast_rh"), table_name="morecast_forecast") + op.drop_index(op.f("ix_morecast_forecast_precip"), table_name="morecast_forecast") + op.drop_index(op.f("ix_morecast_forecast_id"), table_name="morecast_forecast") + op.drop_index(op.f("ix_morecast_forecast_grass_curing"), table_name="morecast_forecast") + op.drop_index(op.f("ix_morecast_forecast_for_date"), table_name="morecast_forecast") + op.drop_index(op.f("ix_morecast_forecast_create_timestamp"), table_name="morecast_forecast") + op.drop_table("morecast_forecast") + op.drop_index( + op.f("ix_morecast_2_materialized_view_update_date"), + table_name="morecast_2_materialized_view", + ) + op.drop_index( + op.f("ix_morecast_2_materialized_view_station_code"), + table_name="morecast_2_materialized_view", + ) + op.drop_index( + op.f("ix_morecast_2_materialized_view_prediction_timestamp"), + table_name="morecast_2_materialized_view", + ) + op.drop_index( + op.f("ix_morecast_2_materialized_view_id"), table_name="morecast_2_materialized_view" + ) + op.drop_table("morecast_2_materialized_view") + op.drop_index(op.f("ix_hourly_actuals_weather_date"), table_name="hourly_actuals") + op.drop_index(op.f("ix_hourly_actuals_temp_valid"), table_name="hourly_actuals") + op.drop_index(op.f("ix_hourly_actuals_station_code"), table_name="hourly_actuals") + op.drop_index(op.f("ix_hourly_actuals_rh_valid"), table_name="hourly_actuals") + op.drop_table("hourly_actuals") + op.drop_table("hfi_fire_start_range") + op.drop_index(op.f("ix_fuel_types_id"), table_name="fuel_types") + op.drop_index(op.f("ix_fuel_types_abbrev"), table_name="fuel_types") + op.drop_table("fuel_types") + op.drop_table("fuel_type_raster") + op.drop_index(op.f("ix_fire_centres_name"), table_name="fire_centres") + op.drop_index(op.f("ix_fire_centres_id"), table_name="fire_centres") + op.drop_table("fire_centres") + op.drop_index(op.f("ix_api_access_audits_path"), table_name="api_access_audits") + op.drop_index(op.f("ix_api_access_audits_create_user"), table_name="api_access_audits") + op.drop_index(op.f("ix_api_access_audits_create_timestamp"), table_name="api_access_audits") + op.drop_table("api_access_audits") + op.drop_index(op.f("ix_advisory_shape_types_name"), table_name="advisory_shape_types") + op.drop_table("advisory_shape_types") + op.drop_index( + op.f("ix_advisory_hfi_classification_threshold_id"), + table_name="advisory_hfi_classification_threshold", + ) + op.drop_table("advisory_hfi_classification_threshold") + # ### end Alembic commands ### diff --git a/backend/packages/wps-api/alembic/versions/004ac48ffe18_indices.py b/backend/packages/wps-api/alembic/versions/archive/004ac48ffe18_indices.py similarity index 100% rename from backend/packages/wps-api/alembic/versions/004ac48ffe18_indices.py rename to backend/packages/wps-api/alembic/versions/archive/004ac48ffe18_indices.py diff --git a/backend/packages/wps-api/alembic/versions/00df3c7b5cba_rethink_classification.py b/backend/packages/wps-api/alembic/versions/archive/00df3c7b5cba_rethink_classification.py similarity index 100% rename from backend/packages/wps-api/alembic/versions/00df3c7b5cba_rethink_classification.py rename to backend/packages/wps-api/alembic/versions/archive/00df3c7b5cba_rethink_classification.py diff --git a/backend/packages/wps-api/alembic/versions/025a81a4b7bd_limit_mat_view_to_21_days.py b/backend/packages/wps-api/alembic/versions/archive/025a81a4b7bd_limit_mat_view_to_21_days.py similarity index 100% rename from backend/packages/wps-api/alembic/versions/025a81a4b7bd_limit_mat_view_to_21_days.py rename to backend/packages/wps-api/alembic/versions/archive/025a81a4b7bd_limit_mat_view_to_21_days.py diff --git a/backend/packages/wps-api/alembic/versions/0669994d4089_add_combust_area_col_to_advisory_shapes.py b/backend/packages/wps-api/alembic/versions/archive/0669994d4089_add_combust_area_col_to_advisory_shapes.py similarity index 100% rename from backend/packages/wps-api/alembic/versions/0669994d4089_add_combust_area_col_to_advisory_shapes.py rename to backend/packages/wps-api/alembic/versions/archive/0669994d4089_add_combust_area_col_to_advisory_shapes.py diff --git a/backend/packages/wps-api/alembic/versions/07007f659064_partition_weather_station_model_.py b/backend/packages/wps-api/alembic/versions/archive/07007f659064_partition_weather_station_model_.py similarity index 100% rename from backend/packages/wps-api/alembic/versions/07007f659064_partition_weather_station_model_.py rename to backend/packages/wps-api/alembic/versions/archive/07007f659064_partition_weather_station_model_.py diff --git a/backend/packages/wps-api/alembic/versions/08799237842e_create_advisory_hfi_percent_conifer_.py b/backend/packages/wps-api/alembic/versions/archive/08799237842e_create_advisory_hfi_percent_conifer_.py similarity index 100% rename from backend/packages/wps-api/alembic/versions/08799237842e_create_advisory_hfi_percent_conifer_.py rename to backend/packages/wps-api/alembic/versions/archive/08799237842e_create_advisory_hfi_percent_conifer_.py diff --git a/backend/packages/wps-api/alembic/versions/0961883640ef_simplify_high_hfi_area.py b/backend/packages/wps-api/alembic/versions/archive/0961883640ef_simplify_high_hfi_area.py similarity index 100% rename from backend/packages/wps-api/alembic/versions/0961883640ef_simplify_high_hfi_area.py rename to backend/packages/wps-api/alembic/versions/archive/0961883640ef_simplify_high_hfi_area.py diff --git a/backend/packages/wps-api/alembic/versions/0d46262707af_alter_morecast_forecast_columns_to_float.py b/backend/packages/wps-api/alembic/versions/archive/0d46262707af_alter_morecast_forecast_columns_to_float.py similarity index 100% rename from backend/packages/wps-api/alembic/versions/0d46262707af_alter_morecast_forecast_columns_to_float.py rename to backend/packages/wps-api/alembic/versions/archive/0d46262707af_alter_morecast_forecast_columns_to_float.py diff --git a/backend/packages/wps-api/alembic/versions/0dd8306467a9_add_sfmsfueltype_data.py b/backend/packages/wps-api/alembic/versions/archive/0dd8306467a9_add_sfmsfueltype_data.py similarity index 100% rename from backend/packages/wps-api/alembic/versions/0dd8306467a9_add_sfmsfueltype_data.py rename to backend/packages/wps-api/alembic/versions/archive/0dd8306467a9_add_sfmsfueltype_data.py diff --git a/backend/packages/wps-api/alembic/versions/0eb9e7f65a50_populate_fuel_type_raster_id_fk_.py b/backend/packages/wps-api/alembic/versions/archive/0eb9e7f65a50_populate_fuel_type_raster_id_fk_.py similarity index 100% rename from backend/packages/wps-api/alembic/versions/0eb9e7f65a50_populate_fuel_type_raster_id_fk_.py rename to backend/packages/wps-api/alembic/versions/archive/0eb9e7f65a50_populate_fuel_type_raster_id_fk_.py diff --git a/backend/packages/wps-api/alembic/versions/128156e36f67_add_status_to_prescription_status.py b/backend/packages/wps-api/alembic/versions/archive/128156e36f67_add_status_to_prescription_status.py similarity index 100% rename from backend/packages/wps-api/alembic/versions/128156e36f67_add_status_to_prescription_status.py rename to backend/packages/wps-api/alembic/versions/archive/128156e36f67_add_status_to_prescription_status.py diff --git a/backend/packages/wps-api/alembic/versions/157ba3a3f3fb_remove_unique_station_per_planning_area_.py b/backend/packages/wps-api/alembic/versions/archive/157ba3a3f3fb_remove_unique_station_per_planning_area_.py similarity index 100% rename from backend/packages/wps-api/alembic/versions/157ba3a3f3fb_remove_unique_station_per_planning_area_.py rename to backend/packages/wps-api/alembic/versions/archive/157ba3a3f3fb_remove_unique_station_per_planning_area_.py diff --git a/backend/packages/wps-api/alembic/versions/16386a52d7bf_update_c7b.py b/backend/packages/wps-api/alembic/versions/archive/16386a52d7bf_update_c7b.py similarity index 100% rename from backend/packages/wps-api/alembic/versions/16386a52d7bf_update_c7b.py rename to backend/packages/wps-api/alembic/versions/archive/16386a52d7bf_update_c7b.py diff --git a/backend/packages/wps-api/alembic/versions/17b1c787f420_advisory_areas.py b/backend/packages/wps-api/alembic/versions/archive/17b1c787f420_advisory_areas.py similarity index 100% rename from backend/packages/wps-api/alembic/versions/17b1c787f420_advisory_areas.py rename to backend/packages/wps-api/alembic/versions/archive/17b1c787f420_advisory_areas.py diff --git a/backend/packages/wps-api/alembic/versions/17b3fb451866_add_back_min_wind_table_with_fk.py b/backend/packages/wps-api/alembic/versions/archive/17b3fb451866_add_back_min_wind_table_with_fk.py similarity index 100% rename from backend/packages/wps-api/alembic/versions/17b3fb451866_add_back_min_wind_table_with_fk.py rename to backend/packages/wps-api/alembic/versions/archive/17b3fb451866_add_back_min_wind_table_with_fk.py diff --git a/backend/packages/wps-api/alembic/versions/1caf3488a340_initial_hfi_data_import.py b/backend/packages/wps-api/alembic/versions/archive/1caf3488a340_initial_hfi_data_import.py similarity index 100% rename from backend/packages/wps-api/alembic/versions/1caf3488a340_initial_hfi_data_import.py rename to backend/packages/wps-api/alembic/versions/archive/1caf3488a340_initial_hfi_data_import.py diff --git a/backend/packages/wps-api/alembic/versions/1e6932096921_fuel_area_per_tpi_class.py b/backend/packages/wps-api/alembic/versions/archive/1e6932096921_fuel_area_per_tpi_class.py similarity index 100% rename from backend/packages/wps-api/alembic/versions/1e6932096921_fuel_area_per_tpi_class.py rename to backend/packages/wps-api/alembic/versions/archive/1e6932096921_fuel_area_per_tpi_class.py diff --git a/backend/packages/wps-api/alembic/versions/2169aa76dfea_add_haida_gwaii_zone_to_cofc.py b/backend/packages/wps-api/alembic/versions/archive/2169aa76dfea_add_haida_gwaii_zone_to_cofc.py similarity index 100% rename from backend/packages/wps-api/alembic/versions/2169aa76dfea_add_haida_gwaii_zone_to_cofc.py rename to backend/packages/wps-api/alembic/versions/archive/2169aa76dfea_add_haida_gwaii_zone_to_cofc.py diff --git a/backend/packages/wps-api/alembic/versions/2442f07d975c_singular_value_weather_model_prediction_.py b/backend/packages/wps-api/alembic/versions/archive/2442f07d975c_singular_value_weather_model_prediction_.py similarity index 100% rename from backend/packages/wps-api/alembic/versions/2442f07d975c_singular_value_weather_model_prediction_.py rename to backend/packages/wps-api/alembic/versions/archive/2442f07d975c_singular_value_weather_model_prediction_.py diff --git a/backend/packages/wps-api/alembic/versions/274bec360d8c_order_planning_areas_in_kfc.json b/backend/packages/wps-api/alembic/versions/archive/274bec360d8c_order_planning_areas_in_kfc.json similarity index 100% rename from backend/packages/wps-api/alembic/versions/274bec360d8c_order_planning_areas_in_kfc.json rename to backend/packages/wps-api/alembic/versions/archive/274bec360d8c_order_planning_areas_in_kfc.json diff --git a/backend/packages/wps-api/alembic/versions/274bec360d8c_order_planning_areas_in_kfc.py b/backend/packages/wps-api/alembic/versions/archive/274bec360d8c_order_planning_areas_in_kfc.py similarity index 100% rename from backend/packages/wps-api/alembic/versions/274bec360d8c_order_planning_areas_in_kfc.py rename to backend/packages/wps-api/alembic/versions/archive/274bec360d8c_order_planning_areas_in_kfc.py diff --git a/backend/packages/wps-api/alembic/versions/298f400dfa64_zonal_elevation_stats.py b/backend/packages/wps-api/alembic/versions/archive/298f400dfa64_zonal_elevation_stats.py similarity index 100% rename from backend/packages/wps-api/alembic/versions/298f400dfa64_zonal_elevation_stats.py rename to backend/packages/wps-api/alembic/versions/archive/298f400dfa64_zonal_elevation_stats.py diff --git a/backend/packages/wps-api/alembic/versions/2b3755392ad8_percent_grass_curing.py b/backend/packages/wps-api/alembic/versions/archive/2b3755392ad8_percent_grass_curing.py similarity index 100% rename from backend/packages/wps-api/alembic/versions/2b3755392ad8_percent_grass_curing.py rename to backend/packages/wps-api/alembic/versions/archive/2b3755392ad8_percent_grass_curing.py diff --git a/backend/packages/wps-api/alembic/versions/2cf10021c5f1_add_hfi_wind_speed_table.py b/backend/packages/wps-api/alembic/versions/archive/2cf10021c5f1_add_hfi_wind_speed_table.py similarity index 100% rename from backend/packages/wps-api/alembic/versions/2cf10021c5f1_add_hfi_wind_speed_table.py rename to backend/packages/wps-api/alembic/versions/archive/2cf10021c5f1_add_hfi_wind_speed_table.py diff --git a/backend/packages/wps-api/alembic/versions/2dac381ad6e7_remove_moose_lake_from_nadina.py b/backend/packages/wps-api/alembic/versions/archive/2dac381ad6e7_remove_moose_lake_from_nadina.py similarity index 100% rename from backend/packages/wps-api/alembic/versions/2dac381ad6e7_remove_moose_lake_from_nadina.py rename to backend/packages/wps-api/alembic/versions/archive/2dac381ad6e7_remove_moose_lake_from_nadina.py diff --git a/backend/packages/wps-api/alembic/versions/305e64ecce19_combustible_area_2021_and_2025.py b/backend/packages/wps-api/alembic/versions/archive/305e64ecce19_combustible_area_2021_and_2025.py similarity index 100% rename from backend/packages/wps-api/alembic/versions/305e64ecce19_combustible_area_2021_and_2025.py rename to backend/packages/wps-api/alembic/versions/archive/305e64ecce19_combustible_area_2021_and_2025.py diff --git a/backend/packages/wps-api/alembic/versions/318e6887e4b0_hfi_request.py b/backend/packages/wps-api/alembic/versions/archive/318e6887e4b0_hfi_request.py similarity index 100% rename from backend/packages/wps-api/alembic/versions/318e6887e4b0_hfi_request.py rename to backend/packages/wps-api/alembic/versions/archive/318e6887e4b0_hfi_request.py diff --git a/backend/packages/wps-api/alembic/versions/35acf3b96d8a_make_planning_weather_stations_cols_non_.py b/backend/packages/wps-api/alembic/versions/archive/35acf3b96d8a_make_planning_weather_stations_cols_non_.py similarity index 100% rename from backend/packages/wps-api/alembic/versions/35acf3b96d8a_make_planning_weather_stations_cols_non_.py rename to backend/packages/wps-api/alembic/versions/archive/35acf3b96d8a_make_planning_weather_stations_cols_non_.py diff --git a/backend/packages/wps-api/alembic/versions/362d268606f3_partition_weather_station_model_.py b/backend/packages/wps-api/alembic/versions/archive/362d268606f3_partition_weather_station_model_.py similarity index 100% rename from backend/packages/wps-api/alembic/versions/362d268606f3_partition_weather_station_model_.py rename to backend/packages/wps-api/alembic/versions/archive/362d268606f3_partition_weather_station_model_.py diff --git a/backend/packages/wps-api/alembic/versions/39806f02cdec_wfwx_update_date_part_of_unique_.py b/backend/packages/wps-api/alembic/versions/archive/39806f02cdec_wfwx_update_date_part_of_unique_.py similarity index 100% rename from backend/packages/wps-api/alembic/versions/39806f02cdec_wfwx_update_date_part_of_unique_.py rename to backend/packages/wps-api/alembic/versions/archive/39806f02cdec_wfwx_update_date_part_of_unique_.py diff --git a/backend/packages/wps-api/alembic/versions/4014ddf1f874_partition_weather_station_model_.py b/backend/packages/wps-api/alembic/versions/archive/4014ddf1f874_partition_weather_station_model_.py similarity index 100% rename from backend/packages/wps-api/alembic/versions/4014ddf1f874_partition_weather_station_model_.py rename to backend/packages/wps-api/alembic/versions/archive/4014ddf1f874_partition_weather_station_model_.py diff --git a/backend/packages/wps-api/alembic/versions/402cff253825_record_if_record_has_been_interpolated.py b/backend/packages/wps-api/alembic/versions/archive/402cff253825_record_if_record_has_been_interpolated.py similarity index 100% rename from backend/packages/wps-api/alembic/versions/402cff253825_record_if_record_has_been_interpolated.py rename to backend/packages/wps-api/alembic/versions/archive/402cff253825_record_if_record_has_been_interpolated.py diff --git a/backend/packages/wps-api/alembic/versions/403586c146ae_processed_snow.py b/backend/packages/wps-api/alembic/versions/archive/403586c146ae_processed_snow.py similarity index 100% rename from backend/packages/wps-api/alembic/versions/403586c146ae_processed_snow.py rename to backend/packages/wps-api/alembic/versions/archive/403586c146ae_processed_snow.py diff --git a/backend/packages/wps-api/alembic/versions/41ec381bf3ee_add_is_deleted_and_audit_cols_to_.py b/backend/packages/wps-api/alembic/versions/archive/41ec381bf3ee_add_is_deleted_and_audit_cols_to_.py similarity index 100% rename from backend/packages/wps-api/alembic/versions/41ec381bf3ee_add_is_deleted_and_audit_cols_to_.py rename to backend/packages/wps-api/alembic/versions/archive/41ec381bf3ee_add_is_deleted_and_audit_cols_to_.py diff --git a/backend/packages/wps-api/alembic/versions/42a9dae10dca_add_ecmwf_model.py b/backend/packages/wps-api/alembic/versions/archive/42a9dae10dca_add_ecmwf_model.py similarity index 100% rename from backend/packages/wps-api/alembic/versions/42a9dae10dca_add_ecmwf_model.py rename to backend/packages/wps-api/alembic/versions/archive/42a9dae10dca_add_ecmwf_model.py diff --git a/backend/packages/wps-api/alembic/versions/43dce8db9afb_added_hfi_calc_tables.py b/backend/packages/wps-api/alembic/versions/archive/43dce8db9afb_added_hfi_calc_tables.py similarity index 100% rename from backend/packages/wps-api/alembic/versions/43dce8db9afb_added_hfi_calc_tables.py rename to backend/packages/wps-api/alembic/versions/archive/43dce8db9afb_added_hfi_calc_tables.py diff --git a/backend/packages/wps-api/alembic/versions/4916cd5313de_morecast_2_materialized_view.py b/backend/packages/wps-api/alembic/versions/archive/4916cd5313de_morecast_2_materialized_view.py similarity index 100% rename from backend/packages/wps-api/alembic/versions/4916cd5313de_morecast_2_materialized_view.py rename to backend/packages/wps-api/alembic/versions/archive/4916cd5313de_morecast_2_materialized_view.py diff --git a/backend/packages/wps-api/alembic/versions/4ac7d9f38f85_allows_null_dewpoint_values_for_hourly_.py b/backend/packages/wps-api/alembic/versions/archive/4ac7d9f38f85_allows_null_dewpoint_values_for_hourly_.py similarity index 100% rename from backend/packages/wps-api/alembic/versions/4ac7d9f38f85_allows_null_dewpoint_values_for_hourly_.py rename to backend/packages/wps-api/alembic/versions/archive/4ac7d9f38f85_allows_null_dewpoint_values_for_hourly_.py diff --git a/backend/packages/wps-api/alembic/versions/4e810be22ffd_allow_null_wind_direction.py b/backend/packages/wps-api/alembic/versions/archive/4e810be22ffd_allow_null_wind_direction.py similarity index 100% rename from backend/packages/wps-api/alembic/versions/4e810be22ffd_allow_null_wind_direction.py rename to backend/packages/wps-api/alembic/versions/archive/4e810be22ffd_allow_null_wind_direction.py diff --git a/backend/packages/wps-api/alembic/versions/4e9664f4962e_add_column_for_ordering_stations_in_.py b/backend/packages/wps-api/alembic/versions/archive/4e9664f4962e_add_column_for_ordering_stations_in_.py similarity index 100% rename from backend/packages/wps-api/alembic/versions/4e9664f4962e_add_column_for_ordering_stations_in_.py rename to backend/packages/wps-api/alembic/versions/archive/4e9664f4962e_add_column_for_ordering_stations_in_.py diff --git a/backend/packages/wps-api/alembic/versions/505a3f03ba75_add_fire_zone_units_to_advisory_shapes.py b/backend/packages/wps-api/alembic/versions/archive/505a3f03ba75_add_fire_zone_units_to_advisory_shapes.py similarity index 100% rename from backend/packages/wps-api/alembic/versions/505a3f03ba75_add_fire_zone_units_to_advisory_shapes.py rename to backend/packages/wps-api/alembic/versions/archive/505a3f03ba75_add_fire_zone_units_to_advisory_shapes.py diff --git a/backend/packages/wps-api/alembic/versions/521681b2d802_drop_min_wind_hfi_table.py b/backend/packages/wps-api/alembic/versions/archive/521681b2d802_drop_min_wind_hfi_table.py similarity index 100% rename from backend/packages/wps-api/alembic/versions/521681b2d802_drop_min_wind_hfi_table.py rename to backend/packages/wps-api/alembic/versions/archive/521681b2d802_drop_min_wind_hfi_table.py diff --git a/backend/packages/wps-api/alembic/versions/52c8a568364e_data_migration_for_default_hfi_ready_.py b/backend/packages/wps-api/alembic/versions/archive/52c8a568364e_data_migration_for_default_hfi_ready_.py similarity index 100% rename from backend/packages/wps-api/alembic/versions/52c8a568364e_data_migration_for_default_hfi_ready_.py rename to backend/packages/wps-api/alembic/versions/archive/52c8a568364e_data_migration_for_default_hfi_ready_.py diff --git a/backend/packages/wps-api/alembic/versions/54176235e225_create_fire_watch_table.py b/backend/packages/wps-api/alembic/versions/archive/54176235e225_create_fire_watch_table.py similarity index 100% rename from backend/packages/wps-api/alembic/versions/54176235e225_create_fire_watch_table.py rename to backend/packages/wps-api/alembic/versions/archive/54176235e225_create_fire_watch_table.py diff --git a/backend/packages/wps-api/alembic/versions/56916d46d8cb_high_hfi_area.py b/backend/packages/wps-api/alembic/versions/archive/56916d46d8cb_high_hfi_area.py similarity index 100% rename from backend/packages/wps-api/alembic/versions/56916d46d8cb_high_hfi_area.py rename to backend/packages/wps-api/alembic/versions/archive/56916d46d8cb_high_hfi_area.py diff --git a/backend/packages/wps-api/alembic/versions/5845f568a975_adds_grass_curing_to_morecast_forecast.py b/backend/packages/wps-api/alembic/versions/archive/5845f568a975_adds_grass_curing_to_morecast_forecast.py similarity index 100% rename from backend/packages/wps-api/alembic/versions/5845f568a975_adds_grass_curing_to_morecast_forecast.py rename to backend/packages/wps-api/alembic/versions/archive/5845f568a975_adds_grass_curing_to_morecast_forecast.py diff --git a/backend/packages/wps-api/alembic/versions/5b745fe0bd7a_add_station_code_to_modelrunprediction.py b/backend/packages/wps-api/alembic/versions/archive/5b745fe0bd7a_add_station_code_to_modelrunprediction.py similarity index 100% rename from backend/packages/wps-api/alembic/versions/5b745fe0bd7a_add_station_code_to_modelrunprediction.py rename to backend/packages/wps-api/alembic/versions/archive/5b745fe0bd7a_add_station_code_to_modelrunprediction.py diff --git a/backend/packages/wps-api/alembic/versions/62d35d76e1bf_enforce_single_active_station_per_.py b/backend/packages/wps-api/alembic/versions/archive/62d35d76e1bf_enforce_single_active_station_per_.py similarity index 100% rename from backend/packages/wps-api/alembic/versions/62d35d76e1bf_enforce_single_active_station_per_.py rename to backend/packages/wps-api/alembic/versions/archive/62d35d76e1bf_enforce_single_active_station_per_.py diff --git a/backend/packages/wps-api/alembic/versions/65d5edb3f200_add_fire_watch_weather_and_prescription_.py b/backend/packages/wps-api/alembic/versions/archive/65d5edb3f200_add_fire_watch_weather_and_prescription_.py similarity index 100% rename from backend/packages/wps-api/alembic/versions/65d5edb3f200_add_fire_watch_weather_and_prescription_.py rename to backend/packages/wps-api/alembic/versions/archive/65d5edb3f200_add_fire_watch_weather_and_prescription_.py diff --git a/backend/packages/wps-api/alembic/versions/6910d017b626_add_advisory_tpi_table.py b/backend/packages/wps-api/alembic/versions/archive/6910d017b626_add_advisory_tpi_table.py similarity index 100% rename from backend/packages/wps-api/alembic/versions/6910d017b626_add_advisory_tpi_table.py rename to backend/packages/wps-api/alembic/versions/archive/6910d017b626_add_advisory_tpi_table.py diff --git a/backend/packages/wps-api/alembic/versions/69cbd7ca2477_add_gfs_prediction_model.py b/backend/packages/wps-api/alembic/versions/archive/69cbd7ca2477_add_gfs_prediction_model.py similarity index 100% rename from backend/packages/wps-api/alembic/versions/69cbd7ca2477_add_gfs_prediction_model.py rename to backend/packages/wps-api/alembic/versions/archive/69cbd7ca2477_add_gfs_prediction_model.py diff --git a/backend/packages/wps-api/alembic/versions/6a31639810b0_add_green_lake_planning_area.py b/backend/packages/wps-api/alembic/versions/archive/6a31639810b0_add_green_lake_planning_area.py similarity index 100% rename from backend/packages/wps-api/alembic/versions/6a31639810b0_add_green_lake_planning_area.py rename to backend/packages/wps-api/alembic/versions/archive/6a31639810b0_add_green_lake_planning_area.py diff --git a/backend/packages/wps-api/alembic/versions/6d29ebbf61f7_remove_moose_lake_from_vanjam.py b/backend/packages/wps-api/alembic/versions/archive/6d29ebbf61f7_remove_moose_lake_from_vanjam.py similarity index 100% rename from backend/packages/wps-api/alembic/versions/6d29ebbf61f7_remove_moose_lake_from_vanjam.py rename to backend/packages/wps-api/alembic/versions/archive/6d29ebbf61f7_remove_moose_lake_from_vanjam.py diff --git a/backend/packages/wps-api/alembic/versions/6d2f4d058ebc_add_column_for_order_of_appearance_in_.json b/backend/packages/wps-api/alembic/versions/archive/6d2f4d058ebc_add_column_for_order_of_appearance_in_.json similarity index 100% rename from backend/packages/wps-api/alembic/versions/6d2f4d058ebc_add_column_for_order_of_appearance_in_.json rename to backend/packages/wps-api/alembic/versions/archive/6d2f4d058ebc_add_column_for_order_of_appearance_in_.json diff --git a/backend/packages/wps-api/alembic/versions/6d2f4d058ebc_add_column_for_order_of_appearance_in_.py b/backend/packages/wps-api/alembic/versions/archive/6d2f4d058ebc_add_column_for_order_of_appearance_in_.py similarity index 100% rename from backend/packages/wps-api/alembic/versions/6d2f4d058ebc_add_column_for_order_of_appearance_in_.py rename to backend/packages/wps-api/alembic/versions/archive/6d2f4d058ebc_add_column_for_order_of_appearance_in_.py diff --git a/backend/packages/wps-api/alembic/versions/6d3221d339c8_add_complete_column_to_run_parameters.py b/backend/packages/wps-api/alembic/versions/archive/6d3221d339c8_add_complete_column_to_run_parameters.py similarity index 100% rename from backend/packages/wps-api/alembic/versions/6d3221d339c8_add_complete_column_to_run_parameters.py rename to backend/packages/wps-api/alembic/versions/archive/6d3221d339c8_add_complete_column_to_run_parameters.py diff --git a/backend/packages/wps-api/alembic/versions/6d5a3c660f1a_drop_c_haines_step_b.py b/backend/packages/wps-api/alembic/versions/archive/6d5a3c660f1a_drop_c_haines_step_b.py similarity index 100% rename from backend/packages/wps-api/alembic/versions/6d5a3c660f1a_drop_c_haines_step_b.py rename to backend/packages/wps-api/alembic/versions/archive/6d5a3c660f1a_drop_c_haines_step_b.py diff --git a/backend/packages/wps-api/alembic/versions/6ec6afd92af3_add_label_and_fire_centre_field_to_.py b/backend/packages/wps-api/alembic/versions/archive/6ec6afd92af3_add_label_and_fire_centre_field_to_.py similarity index 100% rename from backend/packages/wps-api/alembic/versions/6ec6afd92af3_add_label_and_fire_centre_field_to_.py rename to backend/packages/wps-api/alembic/versions/archive/6ec6afd92af3_add_label_and_fire_centre_field_to_.py diff --git a/backend/packages/wps-api/alembic/versions/6f6effb6b004_add_complete_flag_to_prediction_model.py b/backend/packages/wps-api/alembic/versions/archive/6f6effb6b004_add_complete_flag_to_prediction_model.py similarity index 100% rename from backend/packages/wps-api/alembic/versions/6f6effb6b004_add_complete_flag_to_prediction_model.py rename to backend/packages/wps-api/alembic/versions/archive/6f6effb6b004_add_complete_flag_to_prediction_model.py diff --git a/backend/packages/wps-api/alembic/versions/7bedf64b703c_bias_adjusted_temperature_and_rh.py b/backend/packages/wps-api/alembic/versions/archive/7bedf64b703c_bias_adjusted_temperature_and_rh.py similarity index 100% rename from backend/packages/wps-api/alembic/versions/7bedf64b703c_bias_adjusted_temperature_and_rh.py rename to backend/packages/wps-api/alembic/versions/archive/7bedf64b703c_bias_adjusted_temperature_and_rh.py diff --git a/backend/packages/wps-api/alembic/versions/7cd069b79aaa_add_advisory_fuel_stats_table.py b/backend/packages/wps-api/alembic/versions/archive/7cd069b79aaa_add_advisory_fuel_stats_table.py similarity index 100% rename from backend/packages/wps-api/alembic/versions/7cd069b79aaa_add_advisory_fuel_stats_table.py rename to backend/packages/wps-api/alembic/versions/archive/7cd069b79aaa_add_advisory_fuel_stats_table.py diff --git a/backend/packages/wps-api/alembic/versions/7d240064d71a_change_classified_hfi_run_date_to_run_.py b/backend/packages/wps-api/alembic/versions/archive/7d240064d71a_change_classified_hfi_run_date_to_run_.py similarity index 100% rename from backend/packages/wps-api/alembic/versions/7d240064d71a_change_classified_hfi_run_date_to_run_.py rename to backend/packages/wps-api/alembic/versions/archive/7d240064d71a_change_classified_hfi_run_date_to_run_.py diff --git a/backend/packages/wps-api/alembic/versions/81c96876355a_c_haines.py b/backend/packages/wps-api/alembic/versions/archive/81c96876355a_c_haines.py similarity index 100% rename from backend/packages/wps-api/alembic/versions/81c96876355a_c_haines.py rename to backend/packages/wps-api/alembic/versions/archive/81c96876355a_c_haines.py diff --git a/backend/packages/wps-api/alembic/versions/82cc8ffa75ce_update_kamloops_stations.py b/backend/packages/wps-api/alembic/versions/archive/82cc8ffa75ce_update_kamloops_stations.py similarity index 100% rename from backend/packages/wps-api/alembic/versions/82cc8ffa75ce_update_kamloops_stations.py rename to backend/packages/wps-api/alembic/versions/archive/82cc8ffa75ce_update_kamloops_stations.py diff --git a/backend/packages/wps-api/alembic/versions/839f18e0ecc4_insert_c7b.py b/backend/packages/wps-api/alembic/versions/archive/839f18e0ecc4_insert_c7b.py similarity index 100% rename from backend/packages/wps-api/alembic/versions/839f18e0ecc4_insert_c7b.py rename to backend/packages/wps-api/alembic/versions/archive/839f18e0ecc4_insert_c7b.py diff --git a/backend/packages/wps-api/alembic/versions/8635552697ad_populate_label_and_fire_centre_for_.py b/backend/packages/wps-api/alembic/versions/archive/8635552697ad_populate_label_and_fire_centre_for_.py similarity index 100% rename from backend/packages/wps-api/alembic/versions/8635552697ad_populate_label_and_fire_centre_for_.py rename to backend/packages/wps-api/alembic/versions/archive/8635552697ad_populate_label_and_fire_centre_for_.py diff --git a/backend/packages/wps-api/alembic/versions/871c39cf6c26_fuel_type_abbreviation_should_be_unique.py b/backend/packages/wps-api/alembic/versions/archive/871c39cf6c26_fuel_type_abbreviation_should_be_unique.py similarity index 100% rename from backend/packages/wps-api/alembic/versions/871c39cf6c26_fuel_type_abbreviation_should_be_unique.py rename to backend/packages/wps-api/alembic/versions/archive/871c39cf6c26_fuel_type_abbreviation_should_be_unique.py diff --git a/backend/packages/wps-api/alembic/versions/891900abdb6b_load_forecast_model_definitions.py b/backend/packages/wps-api/alembic/versions/archive/891900abdb6b_load_forecast_model_definitions.py similarity index 100% rename from backend/packages/wps-api/alembic/versions/891900abdb6b_load_forecast_model_definitions.py rename to backend/packages/wps-api/alembic/versions/archive/891900abdb6b_load_forecast_model_definitions.py diff --git a/backend/packages/wps-api/alembic/versions/8a05bc230ad7_add_fire_zone_unit_to_shapetypeenum.py b/backend/packages/wps-api/alembic/versions/archive/8a05bc230ad7_add_fire_zone_unit_to_shapetypeenum.py similarity index 100% rename from backend/packages/wps-api/alembic/versions/8a05bc230ad7_add_fire_zone_unit_to_shapetypeenum.py rename to backend/packages/wps-api/alembic/versions/archive/8a05bc230ad7_add_fire_zone_unit_to_shapetypeenum.py diff --git a/backend/packages/wps-api/alembic/versions/8bca5e25546e_rename_tables.py b/backend/packages/wps-api/alembic/versions/archive/8bca5e25546e_rename_tables.py similarity index 100% rename from backend/packages/wps-api/alembic/versions/8bca5e25546e_rename_tables.py rename to backend/packages/wps-api/alembic/versions/archive/8bca5e25546e_rename_tables.py diff --git a/backend/packages/wps-api/alembic/versions/8e85e2b291a9_remove_zone_shapes.py b/backend/packages/wps-api/alembic/versions/archive/8e85e2b291a9_remove_zone_shapes.py similarity index 100% rename from backend/packages/wps-api/alembic/versions/8e85e2b291a9_remove_zone_shapes.py rename to backend/packages/wps-api/alembic/versions/archive/8e85e2b291a9_remove_zone_shapes.py diff --git a/backend/packages/wps-api/alembic/versions/8efe0e7b9712_add_remaining_fcs_for_hfi.json b/backend/packages/wps-api/alembic/versions/archive/8efe0e7b9712_add_remaining_fcs_for_hfi.json similarity index 100% rename from backend/packages/wps-api/alembic/versions/8efe0e7b9712_add_remaining_fcs_for_hfi.json rename to backend/packages/wps-api/alembic/versions/archive/8efe0e7b9712_add_remaining_fcs_for_hfi.json diff --git a/backend/packages/wps-api/alembic/versions/8efe0e7b9712_add_remaining_fcs_for_hfi.py b/backend/packages/wps-api/alembic/versions/archive/8efe0e7b9712_add_remaining_fcs_for_hfi.py similarity index 100% rename from backend/packages/wps-api/alembic/versions/8efe0e7b9712_add_remaining_fcs_for_hfi.py rename to backend/packages/wps-api/alembic/versions/archive/8efe0e7b9712_add_remaining_fcs_for_hfi.py diff --git a/backend/packages/wps-api/alembic/versions/9298059a1912_populate_missing_fuel_type_raster_ids.py b/backend/packages/wps-api/alembic/versions/archive/9298059a1912_populate_missing_fuel_type_raster_ids.py similarity index 100% rename from backend/packages/wps-api/alembic/versions/9298059a1912_populate_missing_fuel_type_raster_ids.py rename to backend/packages/wps-api/alembic/versions/archive/9298059a1912_populate_missing_fuel_type_raster_ids.py diff --git a/backend/packages/wps-api/alembic/versions/92dad9590164_add_pc_and_pdf_columns_to_fueltype.py b/backend/packages/wps-api/alembic/versions/archive/92dad9590164_add_pc_and_pdf_columns_to_fueltype.py similarity index 100% rename from backend/packages/wps-api/alembic/versions/92dad9590164_add_pc_and_pdf_columns_to_fueltype.py rename to backend/packages/wps-api/alembic/versions/archive/92dad9590164_add_pc_and_pdf_columns_to_fueltype.py diff --git a/backend/packages/wps-api/alembic/versions/935bde11a18b_drop_c_haines_step_a.py b/backend/packages/wps-api/alembic/versions/archive/935bde11a18b_drop_c_haines_step_a.py similarity index 100% rename from backend/packages/wps-api/alembic/versions/935bde11a18b_drop_c_haines_step_a.py rename to backend/packages/wps-api/alembic/versions/archive/935bde11a18b_drop_c_haines_step_a.py diff --git a/backend/packages/wps-api/alembic/versions/945a5d8e55b6_alter_fire_watch_optional_columns.py b/backend/packages/wps-api/alembic/versions/archive/945a5d8e55b6_alter_fire_watch_optional_columns.py similarity index 100% rename from backend/packages/wps-api/alembic/versions/945a5d8e55b6_alter_fire_watch_optional_columns.py rename to backend/packages/wps-api/alembic/versions/archive/945a5d8e55b6_alter_fire_watch_optional_columns.py diff --git a/backend/packages/wps-api/alembic/versions/971848399c46_add_extra_sfms_fuel_type.py b/backend/packages/wps-api/alembic/versions/archive/971848399c46_add_extra_sfms_fuel_type.py similarity index 100% rename from backend/packages/wps-api/alembic/versions/971848399c46_add_extra_sfms_fuel_type.py rename to backend/packages/wps-api/alembic/versions/archive/971848399c46_add_extra_sfms_fuel_type.py diff --git a/backend/packages/wps-api/alembic/versions/9a5bb047ae19_import_revised_hfi_calc_data.json b/backend/packages/wps-api/alembic/versions/archive/9a5bb047ae19_import_revised_hfi_calc_data.json similarity index 100% rename from backend/packages/wps-api/alembic/versions/9a5bb047ae19_import_revised_hfi_calc_data.json rename to backend/packages/wps-api/alembic/versions/archive/9a5bb047ae19_import_revised_hfi_calc_data.json diff --git a/backend/packages/wps-api/alembic/versions/9a5bb047ae19_import_revised_hfi_calc_data.py b/backend/packages/wps-api/alembic/versions/archive/9a5bb047ae19_import_revised_hfi_calc_data.py similarity index 100% rename from backend/packages/wps-api/alembic/versions/9a5bb047ae19_import_revised_hfi_calc_data.py rename to backend/packages/wps-api/alembic/versions/archive/9a5bb047ae19_import_revised_hfi_calc_data.py diff --git a/backend/packages/wps-api/alembic/versions/9cfbe9f618e4_update_planning_weather_stations_with_.py b/backend/packages/wps-api/alembic/versions/archive/9cfbe9f618e4_update_planning_weather_stations_with_.py similarity index 100% rename from backend/packages/wps-api/alembic/versions/9cfbe9f618e4_update_planning_weather_stations_with_.py rename to backend/packages/wps-api/alembic/versions/archive/9cfbe9f618e4_update_planning_weather_stations_with_.py diff --git a/backend/packages/wps-api/alembic/versions/a1553ead7fde_add_processed_fuel_raster_table.py b/backend/packages/wps-api/alembic/versions/archive/a1553ead7fde_add_processed_fuel_raster_table.py similarity index 100% rename from backend/packages/wps-api/alembic/versions/a1553ead7fde_add_processed_fuel_raster_table.py rename to backend/packages/wps-api/alembic/versions/archive/a1553ead7fde_add_processed_fuel_raster_table.py diff --git a/backend/packages/wps-api/alembic/versions/aa34d6c338e6_create_noon_forecasts.py b/backend/packages/wps-api/alembic/versions/archive/aa34d6c338e6_create_noon_forecasts.py similarity index 100% rename from backend/packages/wps-api/alembic/versions/aa34d6c338e6_create_noon_forecasts.py rename to backend/packages/wps-api/alembic/versions/archive/aa34d6c338e6_create_noon_forecasts.py diff --git a/backend/packages/wps-api/alembic/versions/aa82757b1084_adds_audit_model.py b/backend/packages/wps-api/alembic/versions/archive/aa82757b1084_adds_audit_model.py similarity index 100% rename from backend/packages/wps-api/alembic/versions/aa82757b1084_adds_audit_model.py rename to backend/packages/wps-api/alembic/versions/archive/aa82757b1084_adds_audit_model.py diff --git a/backend/packages/wps-api/alembic/versions/ac65354014bd_remove_bear_lake_station.py b/backend/packages/wps-api/alembic/versions/archive/ac65354014bd_remove_bear_lake_station.py similarity index 100% rename from backend/packages/wps-api/alembic/versions/ac65354014bd_remove_bear_lake_station.py rename to backend/packages/wps-api/alembic/versions/archive/ac65354014bd_remove_bear_lake_station.py diff --git a/backend/packages/wps-api/alembic/versions/ad4f37763020_add_wind.py b/backend/packages/wps-api/alembic/versions/archive/ad4f37763020_add_wind.py similarity index 100% rename from backend/packages/wps-api/alembic/versions/ad4f37763020_add_wind.py rename to backend/packages/wps-api/alembic/versions/archive/ad4f37763020_add_wind.py diff --git a/backend/packages/wps-api/alembic/versions/af108f346073_remove_redundant_constraint.py b/backend/packages/wps-api/alembic/versions/archive/af108f346073_remove_redundant_constraint.py similarity index 100% rename from backend/packages/wps-api/alembic/versions/af108f346073_remove_redundant_constraint.py rename to backend/packages/wps-api/alembic/versions/archive/af108f346073_remove_redundant_constraint.py diff --git a/backend/packages/wps-api/alembic/versions/b29cbd0bb078_initial_revision.py b/backend/packages/wps-api/alembic/versions/archive/b29cbd0bb078_initial_revision.py similarity index 100% rename from backend/packages/wps-api/alembic/versions/b29cbd0bb078_initial_revision.py rename to backend/packages/wps-api/alembic/versions/archive/b29cbd0bb078_initial_revision.py diff --git a/backend/packages/wps-api/alembic/versions/b557469a7727_modify_unique_constraint_on_planning_.py b/backend/packages/wps-api/alembic/versions/archive/b557469a7727_modify_unique_constraint_on_planning_.py similarity index 100% rename from backend/packages/wps-api/alembic/versions/b557469a7727_modify_unique_constraint_on_planning_.py rename to backend/packages/wps-api/alembic/versions/archive/b557469a7727_modify_unique_constraint_on_planning_.py diff --git a/backend/packages/wps-api/alembic/versions/b8aa2d38e9e1_add_bias_adj_cols_for_wind.py b/backend/packages/wps-api/alembic/versions/archive/b8aa2d38e9e1_add_bias_adj_cols_for_wind.py similarity index 100% rename from backend/packages/wps-api/alembic/versions/b8aa2d38e9e1_add_bias_adj_cols_for_wind.py rename to backend/packages/wps-api/alembic/versions/archive/b8aa2d38e9e1_add_bias_adj_cols_for_wind.py diff --git a/backend/packages/wps-api/alembic/versions/b99dce009b9f_change_default_fuel_types_for_coastal_.py b/backend/packages/wps-api/alembic/versions/archive/b99dce009b9f_change_default_fuel_types_for_coastal_.py similarity index 100% rename from backend/packages/wps-api/alembic/versions/b99dce009b9f_change_default_fuel_types_for_coastal_.py rename to backend/packages/wps-api/alembic/versions/archive/b99dce009b9f_change_default_fuel_types_for_coastal_.py diff --git a/backend/packages/wps-api/alembic/versions/baa3e0182740_add_hfi_ready_table.py b/backend/packages/wps-api/alembic/versions/archive/baa3e0182740_add_hfi_ready_table.py similarity index 100% rename from backend/packages/wps-api/alembic/versions/baa3e0182740_add_hfi_ready_table.py rename to backend/packages/wps-api/alembic/versions/archive/baa3e0182740_add_hfi_ready_table.py diff --git a/backend/packages/wps-api/alembic/versions/be128a7bb4fd_rdps_storage.py b/backend/packages/wps-api/alembic/versions/archive/be128a7bb4fd_rdps_storage.py similarity index 100% rename from backend/packages/wps-api/alembic/versions/be128a7bb4fd_rdps_storage.py rename to backend/packages/wps-api/alembic/versions/archive/be128a7bb4fd_rdps_storage.py diff --git a/backend/packages/wps-api/alembic/versions/c04f22e31997_import_zones.py b/backend/packages/wps-api/alembic/versions/archive/c04f22e31997_import_zones.py similarity index 100% rename from backend/packages/wps-api/alembic/versions/c04f22e31997_import_zones.py rename to backend/packages/wps-api/alembic/versions/archive/c04f22e31997_import_zones.py diff --git a/backend/packages/wps-api/alembic/versions/c2cd7a585bbd_recompute_combustible_area.py b/backend/packages/wps-api/alembic/versions/archive/c2cd7a585bbd_recompute_combustible_area.py similarity index 100% rename from backend/packages/wps-api/alembic/versions/c2cd7a585bbd_recompute_combustible_area.py rename to backend/packages/wps-api/alembic/versions/archive/c2cd7a585bbd_recompute_combustible_area.py diff --git a/backend/packages/wps-api/alembic/versions/c525dbd0c37e_populate_fire_start_range.py b/backend/packages/wps-api/alembic/versions/archive/c525dbd0c37e_populate_fire_start_range.py similarity index 100% rename from backend/packages/wps-api/alembic/versions/c525dbd0c37e_populate_fire_start_range.py rename to backend/packages/wps-api/alembic/versions/archive/c525dbd0c37e_populate_fire_start_range.py diff --git a/backend/packages/wps-api/alembic/versions/c5bea0920d53_adds_placename_labels_to_advisory_shapes.py b/backend/packages/wps-api/alembic/versions/archive/c5bea0920d53_adds_placename_labels_to_advisory_shapes.py similarity index 100% rename from backend/packages/wps-api/alembic/versions/c5bea0920d53_adds_placename_labels_to_advisory_shapes.py rename to backend/packages/wps-api/alembic/versions/archive/c5bea0920d53_adds_placename_labels_to_advisory_shapes.py diff --git a/backend/packages/wps-api/alembic/versions/c766f89f4584_populate_tpi_fuel_area_table_2025.py b/backend/packages/wps-api/alembic/versions/archive/c766f89f4584_populate_tpi_fuel_area_table_2025.py similarity index 100% rename from backend/packages/wps-api/alembic/versions/c766f89f4584_populate_tpi_fuel_area_table_2025.py rename to backend/packages/wps-api/alembic/versions/archive/c766f89f4584_populate_tpi_fuel_area_table_2025.py diff --git a/backend/packages/wps-api/alembic/versions/c9e46d098c73_critical_hours.py b/backend/packages/wps-api/alembic/versions/archive/c9e46d098c73_critical_hours.py similarity index 100% rename from backend/packages/wps-api/alembic/versions/c9e46d098c73_critical_hours.py rename to backend/packages/wps-api/alembic/versions/archive/c9e46d098c73_critical_hours.py diff --git a/backend/packages/wps-api/alembic/versions/c9f9b2849fef_weather_station_model_prediction.py b/backend/packages/wps-api/alembic/versions/archive/c9f9b2849fef_weather_station_model_prediction.py similarity index 100% rename from backend/packages/wps-api/alembic/versions/c9f9b2849fef_weather_station_model_prediction.py rename to backend/packages/wps-api/alembic/versions/archive/c9f9b2849fef_weather_station_model_prediction.py diff --git a/backend/packages/wps-api/alembic/versions/cacd97331dcb_french_bar_to_c7.py b/backend/packages/wps-api/alembic/versions/archive/cacd97331dcb_french_bar_to_c7.py similarity index 100% rename from backend/packages/wps-api/alembic/versions/cacd97331dcb_french_bar_to_c7.py rename to backend/packages/wps-api/alembic/versions/archive/cacd97331dcb_french_bar_to_c7.py diff --git a/backend/packages/wps-api/alembic/versions/cb626d81dec9_load_fuel_types.py b/backend/packages/wps-api/alembic/versions/archive/cb626d81dec9_load_fuel_types.py similarity index 100% rename from backend/packages/wps-api/alembic/versions/cb626d81dec9_load_fuel_types.py rename to backend/packages/wps-api/alembic/versions/archive/cb626d81dec9_load_fuel_types.py diff --git a/backend/packages/wps-api/alembic/versions/ccf8f6a9c20a_add_acc_delta_precip_for_models_schemas.py b/backend/packages/wps-api/alembic/versions/archive/ccf8f6a9c20a_add_acc_delta_precip_for_models_schemas.py similarity index 100% rename from backend/packages/wps-api/alembic/versions/ccf8f6a9c20a_add_acc_delta_precip_for_models_schemas.py rename to backend/packages/wps-api/alembic/versions/archive/ccf8f6a9c20a_add_acc_delta_precip_for_models_schemas.py diff --git a/backend/packages/wps-api/alembic/versions/ce6588fe9c18_populate_fuel_type_raster_table.py b/backend/packages/wps-api/alembic/versions/archive/ce6588fe9c18_populate_fuel_type_raster_table.py similarity index 100% rename from backend/packages/wps-api/alembic/versions/ce6588fe9c18_populate_fuel_type_raster_table.py rename to backend/packages/wps-api/alembic/versions/archive/ce6588fe9c18_populate_fuel_type_raster_table.py diff --git a/backend/packages/wps-api/alembic/versions/d1d57c17e40e_fuel_type_areas_in_fire_zone_units.py b/backend/packages/wps-api/alembic/versions/archive/d1d57c17e40e_fuel_type_areas_in_fire_zone_units.py similarity index 100% rename from backend/packages/wps-api/alembic/versions/d1d57c17e40e_fuel_type_areas_in_fire_zone_units.py rename to backend/packages/wps-api/alembic/versions/archive/d1d57c17e40e_fuel_type_areas_in_fire_zone_units.py diff --git a/backend/packages/wps-api/alembic/versions/d276ba9eed1f_add_advisory_zone_status_table.py b/backend/packages/wps-api/alembic/versions/archive/d276ba9eed1f_add_advisory_zone_status_table.py similarity index 100% rename from backend/packages/wps-api/alembic/versions/d276ba9eed1f_add_advisory_zone_status_table.py rename to backend/packages/wps-api/alembic/versions/archive/d276ba9eed1f_add_advisory_zone_status_table.py diff --git a/backend/packages/wps-api/alembic/versions/d392e4a5a499_delete_fuel_stats_for_re_calculation.py b/backend/packages/wps-api/alembic/versions/archive/d392e4a5a499_delete_fuel_stats_for_re_calculation.py similarity index 100% rename from backend/packages/wps-api/alembic/versions/d392e4a5a499_delete_fuel_stats_for_re_calculation.py rename to backend/packages/wps-api/alembic/versions/archive/d392e4a5a499_delete_fuel_stats_for_re_calculation.py diff --git a/backend/packages/wps-api/alembic/versions/d5115b761e39_compute_zone_unit_combustible_area.py b/backend/packages/wps-api/alembic/versions/archive/d5115b761e39_compute_zone_unit_combustible_area.py similarity index 100% rename from backend/packages/wps-api/alembic/versions/d5115b761e39_compute_zone_unit_combustible_area.py rename to backend/packages/wps-api/alembic/versions/archive/d5115b761e39_compute_zone_unit_combustible_area.py diff --git a/backend/packages/wps-api/alembic/versions/d99fcdc4800d_add_non_nullable_wfwx_update_date.py b/backend/packages/wps-api/alembic/versions/archive/d99fcdc4800d_add_non_nullable_wfwx_update_date.py similarity index 100% rename from backend/packages/wps-api/alembic/versions/d99fcdc4800d_add_non_nullable_wfwx_update_date.py rename to backend/packages/wps-api/alembic/versions/archive/d99fcdc4800d_add_non_nullable_wfwx_update_date.py diff --git a/backend/packages/wps-api/alembic/versions/d9c05cb16869_add_combustible_area_data_to_advisory_.py b/backend/packages/wps-api/alembic/versions/archive/d9c05cb16869_add_combustible_area_data_to_advisory_.py similarity index 100% rename from backend/packages/wps-api/alembic/versions/d9c05cb16869_add_combustible_area_data_to_advisory_.py rename to backend/packages/wps-api/alembic/versions/archive/d9c05cb16869_add_combustible_area_data_to_advisory_.py diff --git a/backend/packages/wps-api/alembic/versions/de8355996f8e_morecast_forecast_table.py b/backend/packages/wps-api/alembic/versions/archive/de8355996f8e_morecast_forecast_table.py similarity index 100% rename from backend/packages/wps-api/alembic/versions/de8355996f8e_morecast_forecast_table.py rename to backend/packages/wps-api/alembic/versions/archive/de8355996f8e_morecast_forecast_table.py diff --git a/backend/packages/wps-api/alembic/versions/e201ae32516e_add_nam_weather_model.py b/backend/packages/wps-api/alembic/versions/archive/e201ae32516e_add_nam_weather_model.py similarity index 100% rename from backend/packages/wps-api/alembic/versions/e201ae32516e_add_nam_weather_model.py rename to backend/packages/wps-api/alembic/versions/archive/e201ae32516e_add_nam_weather_model.py diff --git a/backend/packages/wps-api/alembic/versions/e40076a1b002_add_combustible_area_table.py b/backend/packages/wps-api/alembic/versions/archive/e40076a1b002_add_combustible_area_table.py similarity index 100% rename from backend/packages/wps-api/alembic/versions/e40076a1b002_add_combustible_area_table.py rename to backend/packages/wps-api/alembic/versions/archive/e40076a1b002_add_combustible_area_table.py diff --git a/backend/packages/wps-api/alembic/versions/e55ea62e7ec1_add_hrdps_model.py b/backend/packages/wps-api/alembic/versions/archive/e55ea62e7ec1_add_hrdps_model.py similarity index 100% rename from backend/packages/wps-api/alembic/versions/e55ea62e7ec1_add_hrdps_model.py rename to backend/packages/wps-api/alembic/versions/archive/e55ea62e7ec1_add_hrdps_model.py diff --git a/backend/packages/wps-api/alembic/versions/e71f0965f6e0_fuel_type.py b/backend/packages/wps-api/alembic/versions/archive/e71f0965f6e0_fuel_type.py similarity index 100% rename from backend/packages/wps-api/alembic/versions/e71f0965f6e0_fuel_type.py rename to backend/packages/wps-api/alembic/versions/archive/e71f0965f6e0_fuel_type.py diff --git a/backend/packages/wps-api/alembic/versions/e94f982e723c_populate_advisory_shape_fuels_with_2021_.py b/backend/packages/wps-api/alembic/versions/archive/e94f982e723c_populate_advisory_shape_fuels_with_2021_.py similarity index 100% rename from backend/packages/wps-api/alembic/versions/e94f982e723c_populate_advisory_shape_fuels_with_2021_.py rename to backend/packages/wps-api/alembic/versions/archive/e94f982e723c_populate_advisory_shape_fuels_with_2021_.py diff --git a/backend/packages/wps-api/alembic/versions/ecdace5bfc4f_partition_date_correction.py b/backend/packages/wps-api/alembic/versions/archive/ecdace5bfc4f_partition_date_correction.py similarity index 100% rename from backend/packages/wps-api/alembic/versions/ecdace5bfc4f_partition_date_correction.py rename to backend/packages/wps-api/alembic/versions/archive/ecdace5bfc4f_partition_date_correction.py diff --git a/backend/packages/wps-api/alembic/versions/edb25d3a5286_index_update_date_on_weather_model_.py b/backend/packages/wps-api/alembic/versions/archive/edb25d3a5286_index_update_date_on_weather_model_.py similarity index 100% rename from backend/packages/wps-api/alembic/versions/edb25d3a5286_index_update_date_on_weather_model_.py rename to backend/packages/wps-api/alembic/versions/archive/edb25d3a5286_index_update_date_on_weather_model_.py diff --git a/backend/packages/wps-api/alembic/versions/ee2df2ebe8c0_hourlyactuals.py b/backend/packages/wps-api/alembic/versions/archive/ee2df2ebe8c0_hourlyactuals.py similarity index 100% rename from backend/packages/wps-api/alembic/versions/ee2df2ebe8c0_hourlyactuals.py rename to backend/packages/wps-api/alembic/versions/archive/ee2df2ebe8c0_hourlyactuals.py diff --git a/backend/packages/wps-api/alembic/versions/ef2482f08074_advisory.py b/backend/packages/wps-api/alembic/versions/archive/ef2482f08074_advisory.py similarity index 100% rename from backend/packages/wps-api/alembic/versions/ef2482f08074_advisory.py rename to backend/packages/wps-api/alembic/versions/archive/ef2482f08074_advisory.py diff --git a/backend/packages/wps-api/alembic/versions/f2634e040ee5_add_foreign_key_reference_to_fuel_type_.py b/backend/packages/wps-api/alembic/versions/archive/f2634e040ee5_add_foreign_key_reference_to_fuel_type_.py similarity index 100% rename from backend/packages/wps-api/alembic/versions/f2634e040ee5_add_foreign_key_reference_to_fuel_type_.py rename to backend/packages/wps-api/alembic/versions/archive/f2634e040ee5_add_foreign_key_reference_to_fuel_type_.py diff --git a/backend/packages/wps-api/alembic/versions/f2e027a47a3f_bias_adjusted_precip.py b/backend/packages/wps-api/alembic/versions/archive/f2e027a47a3f_bias_adjusted_precip.py similarity index 100% rename from backend/packages/wps-api/alembic/versions/f2e027a47a3f_bias_adjusted_precip.py rename to backend/packages/wps-api/alembic/versions/archive/f2e027a47a3f_bias_adjusted_precip.py diff --git a/backend/packages/wps-api/alembic/versions/f49418d95584_add_24_hour_precip.py b/backend/packages/wps-api/alembic/versions/archive/f49418d95584_add_24_hour_precip.py similarity index 100% rename from backend/packages/wps-api/alembic/versions/f49418d95584_add_24_hour_precip.py rename to backend/packages/wps-api/alembic/versions/archive/f49418d95584_add_24_hour_precip.py diff --git a/backend/packages/wps-api/alembic/versions/f6400f2140b9_add_bias_adj_wind_cols_to_mat_view.py b/backend/packages/wps-api/alembic/versions/archive/f6400f2140b9_add_bias_adj_wind_cols_to_mat_view.py similarity index 100% rename from backend/packages/wps-api/alembic/versions/f6400f2140b9_add_bias_adj_wind_cols_to_mat_view.py rename to backend/packages/wps-api/alembic/versions/archive/f6400f2140b9_add_bias_adj_wind_cols_to_mat_view.py diff --git a/backend/packages/wps-api/alembic/versions/fa4b3ecb57fe_populate_tpi_fuel_area_table.py b/backend/packages/wps-api/alembic/versions/archive/fa4b3ecb57fe_populate_tpi_fuel_area_table.py similarity index 100% rename from backend/packages/wps-api/alembic/versions/fa4b3ecb57fe_populate_tpi_fuel_area_table.py rename to backend/packages/wps-api/alembic/versions/archive/fa4b3ecb57fe_populate_tpi_fuel_area_table.py diff --git a/backend/packages/wps-api/alembic/versions/fb9d656fdc19_add_data_to_pc_and_pdf_cols__downgrade.json b/backend/packages/wps-api/alembic/versions/archive/fb9d656fdc19_add_data_to_pc_and_pdf_cols__downgrade.json similarity index 100% rename from backend/packages/wps-api/alembic/versions/fb9d656fdc19_add_data_to_pc_and_pdf_cols__downgrade.json rename to backend/packages/wps-api/alembic/versions/archive/fb9d656fdc19_add_data_to_pc_and_pdf_cols__downgrade.json diff --git a/backend/packages/wps-api/alembic/versions/fb9d656fdc19_add_data_to_pc_and_pdf_cols__upgrade.json b/backend/packages/wps-api/alembic/versions/archive/fb9d656fdc19_add_data_to_pc_and_pdf_cols__upgrade.json similarity index 100% rename from backend/packages/wps-api/alembic/versions/fb9d656fdc19_add_data_to_pc_and_pdf_cols__upgrade.json rename to backend/packages/wps-api/alembic/versions/archive/fb9d656fdc19_add_data_to_pc_and_pdf_cols__upgrade.json diff --git a/backend/packages/wps-api/alembic/versions/fb9d656fdc19_add_data_to_pc_and_pdf_cols_in_fuel_.py b/backend/packages/wps-api/alembic/versions/archive/fb9d656fdc19_add_data_to_pc_and_pdf_cols_in_fuel_.py similarity index 100% rename from backend/packages/wps-api/alembic/versions/fb9d656fdc19_add_data_to_pc_and_pdf_cols_in_fuel_.py rename to backend/packages/wps-api/alembic/versions/archive/fb9d656fdc19_add_data_to_pc_and_pdf_cols_in_fuel_.py diff --git a/backend/packages/wps-api/alembic/versions/fbca68ccc9da_classification_thresholds.py b/backend/packages/wps-api/alembic/versions/archive/fbca68ccc9da_classification_thresholds.py similarity index 100% rename from backend/packages/wps-api/alembic/versions/fbca68ccc9da_classification_thresholds.py rename to backend/packages/wps-api/alembic/versions/archive/fbca68ccc9da_classification_thresholds.py diff --git a/backend/packages/wps-api/alembic/versions/fdbf57102d06_add_sfmsfueltype.py b/backend/packages/wps-api/alembic/versions/archive/fdbf57102d06_add_sfmsfueltype.py similarity index 100% rename from backend/packages/wps-api/alembic/versions/fdbf57102d06_add_sfmsfueltype.py rename to backend/packages/wps-api/alembic/versions/archive/fdbf57102d06_add_sfmsfueltype.py diff --git a/backend/packages/wps-api/alembic/versions/fe33ab8c6c01_fire_start_range.py b/backend/packages/wps-api/alembic/versions/archive/fe33ab8c6c01_fire_start_range.py similarity index 100% rename from backend/packages/wps-api/alembic/versions/fe33ab8c6c01_fire_start_range.py rename to backend/packages/wps-api/alembic/versions/archive/fe33ab8c6c01_fire_start_range.py diff --git a/backend/packages/wps-api/alembic/versions/cf8397b26783_create_application_data_tables_metadata.py b/backend/packages/wps-api/alembic/versions/cf8397b26783_create_application_data_tables_metadata.py new file mode 100644 index 0000000000..a048183896 --- /dev/null +++ b/backend/packages/wps-api/alembic/versions/cf8397b26783_create_application_data_tables_metadata.py @@ -0,0 +1,58 @@ +"""create_application_data_tables_metadata + +Revision ID: cf8397b26783 +Revises: 6157a8d08f28 +Create Date: 2026-01-05 15:23:35.446768 + +""" +from alembic import op +import sqlalchemy as sa + + +# revision identifiers, used by Alembic. +revision = 'cf8397b26783' +down_revision = '6157a8d08f28' +branch_labels = None +depends_on = None + + +def upgrade(): + # Create application_data_tables metadata table + op.create_table( + "application_data_tables", + sa.Column("table_name", sa.String(), nullable=False), + sa.Column("description", sa.String(), nullable=True), + sa.Column("seed_order", sa.Integer(), nullable=True), + sa.Column("last_seeded", sa.DateTime(timezone=True), nullable=True), + sa.PrimaryKeyConstraint("table_name"), + ) + + # Populate with metadata for the 18 application data tables + connection = op.get_bind() + connection.execute( + sa.text(""" + INSERT INTO application_data_tables (table_name, description, seed_order, last_seeded) VALUES + ('prediction_models', 'Prediction model definitions', 1, NOW()), + ('fuel_types', 'Fuel type reference data', 2, NOW()), + ('sfms_fuel_types', 'SFMS fuel type mappings', 3, NOW()), + ('prescription_status', 'Prescription status types', 4, NOW()), + ('fire_centres', 'Fire centre boundaries and definitions', 5, NOW()), + ('planning_areas', 'Planning area definitions', 6, NOW()), + ('advisory_hfi_classification_threshold', 'HFI classification thresholds', 7, NOW()), + ('advisory_shape_types', 'Advisory shape type definitions', 8, NOW()), + ('hfi_fire_start_range', 'HFI fire start range definitions', 9, NOW()), + ('hfi_fire_start_lookup', 'HFI fire start lookup data', 10, NOW()), + ('hfi_fire_centre_fire_start_range', 'HFI fire centre fire start ranges', 11, NOW()), + ('fuel_type_raster', 'Fuel type raster metadata', 12, NOW()), + ('planning_weather_stations', 'Planning weather station assignments', 13, NOW()), + ('advisory_shapes', 'Advisory area shapes (fire zones, centres, units)', 14, NOW()), + ('combustible_area', 'Combustible land area calculations', 15, NOW()), + ('tpi_fuel_area', 'Topographic position index fuel area data', 16, NOW()), + ('advisory_fuel_types', 'Fuel type distributions within advisory areas', 17, NOW()), + ('advisory_shape_fuels', 'Advisory shape fuel type relationships', 18, NOW()) + """) + ) + + +def downgrade(): + op.drop_table("application_data_tables")