-- phpMyAdmin SQL Dump
-- version 5.2.3
-- https://www.phpmyadmin.net/
--
-- Host: localhost:3306
-- Generation Time: Oct 12, 2026 at 12:38 AM
-- Server version: 10.11.19-MariaDB
-- PHP Version: 8.4.25
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8mb4 */;
--
-- Database: `intel145_weather`
--
-- --------------------------------------------------------
--
-- Table structure for table `wx_alerts_active`
--
CREATE TABLE `wx_alerts_active` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `location_id` int(10) UNSIGNED NOT NULL,
  `source_id` varchar(32) NOT NULL,
  `external_id` varchar(255) NOT NULL,
  `status` varchar(16) DEFAULT NULL,
  `event` varchar(120) NOT NULL,
  `severity` varchar(20) DEFAULT NULL,
  `urgency` varchar(20) DEFAULT NULL,
  `headline` varchar(500) DEFAULT NULL,
  `description` mediumtext DEFAULT NULL,
  `instruction` mediumtext DEFAULT NULL,
  `onset` datetime DEFAULT NULL,
  `expires` datetime DEFAULT NULL,
  `fetched_at` datetime NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
-- --------------------------------------------------------
--
-- Table structure for table `wx_audit_log`
--
CREATE TABLE `wx_audit_log` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `at` datetime NOT NULL,
  `actor` varchar(64) NOT NULL,
  `action` varchar(64) NOT NULL,
  `detail` text DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
--
-- Dumping data for table `wx_audit_log`
--
-- --------------------------------------------------------
--
-- Table structure for table `wx_forecasts`
--
CREATE TABLE `wx_forecasts` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `location_id` int(10) UNSIGNED NOT NULL,
  `source_id` varchar(32) NOT NULL,
  `fetched_at` datetime NOT NULL,
  `payload_json` mediumtext NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
--
-- Dumping data for table `wx_forecasts`
--
INSERT INTO `wx_forecasts` (`id`, `location_id`, `source_id`, `fetched_at`, `payload_json`) VALUES
(918, 5, 'nws', '2026-10-10 15:30:02', '{\"source\":\"nws\",\"generated_at\":\"2026-10-10T12:20:26+00:00\",\"periods\":[{\"name\":\"Today\",\"start\":\"2026-10-10T08:00:00-04:00\",\"end\":\"2026-10-10T18:00:00-04:00\",\"is_day\":true,\"temp_f\":69,\"temp_low_f\":null,\"precip_pct\":98,\"wind\":\"14 mph E\",\"short\":\"Light Rain\",\"detail\":\"Rain before 2pm, then rain showers. Cloudy, with a high near 69. East wind around 14 mph, with gusts as high as 26 mph. Chance of precipitation is 100%. New rainfall amounts between a quarter and half of an inch possible.\"},{\"name\":\"Tonight\",\"start\":\"2026-10-10T18:00:00-04:00\",\"end\":\"2026-10-11T06:00:00-04:00\",\"is_day\":false,\"temp_f\":65,\"temp_low_f\":null,\"precip_pct\":96,\"wind\":\"7 to 16 mph E\",\"short\":\"Rain Showers\",\"detail\":\"Rain showers before 1am, then showers and thunderstorms. Cloudy, with a low around 65. East wind 7 to 16 mph, with gusts as high as 25 mph. Chance of precipitation is 100%. New rainfall amounts between a half and three quarters of an inch possible.\"},{\"name\":\"Sunday\",\"start\":\"2026-10-11T06:00:00-04:00\",\"end\":\"2026-10-11T18:00:00-04:00\",\"is_day\":true,\"temp_f\":78,\"temp_low_f\":null,\"precip_pct\":74,\"wind\":\"7 to 14 mph S\",\"short\":\"Showers And Thunderstorms Likely\",\"detail\":\"Showers and thunderstorms likely before 9am, then a slight chance of showers and thunderstorms between 9am and 10am, then showers and thunderstorms likely. Mostly cloudy, with a high near 78. South wind 7 to 14 mph, with gusts as high as 22 mph. Chance of precipitation is 70%. New rainfall amounts between a quarter and half of an inch possible.\"},{\"name\":\"Sunday Night\",\"start\":\"2026-10-11T18:00:00-04:00\",\"end\":\"2026-10-12T06:00:00-04:00\",\"is_day\":false,\"temp_f\":61,\"temp_low_f\":null,\"precip_pct\":9,\"wind\":\"6 to 12 mph SW\",\"short\":\"Mostly Clear\",\"detail\":\"Mostly clear, with a low around 61. Southwest wind 6 to 12 mph, with gusts as high as 20 mph. New rainfall amounts less than a tenth of an inch possible.\"},{\"name\":\"Columbus Day\",\"start\":\"2026-10-12T06:00:00-04:00\",\"end\":\"2026-10-12T18:00:00-04:00\",\"is_day\":true,\"temp_f\":81,\"temp_low_f\":null,\"precip_pct\":1,\"wind\":\"7 to 10 mph NW\",\"short\":\"Sunny\",\"detail\":\"Sunny, with a high near 81. Northwest wind 7 to 10 mph, with gusts as high as 18 mph.\"},{\"name\":\"Monday Night\",\"start\":\"2026-10-12T18:00:00-04:00\",\"end\":\"2026-10-13T06:00:00-04:00\",\"is_day\":false,\"temp_f\":58,\"temp_low_f\":null,\"precip_pct\":1,\"wind\":\"2 to 8 mph NW\",\"short\":\"Mostly Clear\",\"detail\":\"Mostly clear, with a low around 58.\"},{\"name\":\"Tuesday\",\"start\":\"2026-10-13T06:00:00-04:00\",\"end\":\"2026-10-13T18:00:00-04:00\",\"is_day\":true,\"temp_f\":86,\"temp_low_f\":null,\"precip_pct\":0,\"wind\":\"5 mph W\",\"short\":\"Sunny\",\"detail\":\"Sunny, with a high near 86.\"},{\"name\":\"Tuesday Night\",\"start\":\"2026-10-13T18:00:00-04:00\",\"end\":\"2026-10-14T06:00:00-04:00\",\"is_day\":false,\"temp_f\":63,\"temp_low_f\":null,\"precip_pct\":1,\"wind\":\"5 mph W\",\"short\":\"Clear\",\"detail\":\"Clear, with a low around 63.\"},{\"name\":\"Wednesday\",\"start\":\"2026-10-14T06:00:00-04:00\",\"end\":\"2026-10-14T18:00:00-04:00\",\"is_day\":true,\"temp_f\":83,\"temp_low_f\":null,\"precip_pct\":1,\"wind\":\"6 mph NW\",\"short\":\"Sunny\",\"detail\":\"Sunny, with a high near 83.\"},{\"name\":\"Wednesday Night\",\"start\":\"2026-10-14T18:00:00-04:00\",\"end\":\"2026-10-15T06:00:00-04:00\",\"is_day\":false,\"temp_f\":58,\"temp_low_f\":null,\"precip_pct\":2,\"wind\":\"5 mph N\",\"short\":\"Clear\",\"detail\":\"Clear, with a low around 58.\"},{\"name\":\"Thursday\",\"start\":\"2026-10-15T06:00:00-04:00\",\"end\":\"2026-10-15T18:00:00-04:00\",\"is_day\":true,\"temp_f\":78,\"temp_low_f\":null,\"precip_pct\":3,\"wind\":\"6 mph E\",\"short\":\"Sunny\",\"detail\":\"Sunny, with a high near 78.\"},{\"name\":\"Thursday Night\",\"start\":\"2026-10-15T18:00:00-04:00\",\"end\":\"2026-10-16T06:00:00-04:00\",\"is_day\":false,\"temp_f\":56,\"temp_low_f\":null,\"precip_pct\":4,\"wind\":\"5 mph SE\",\"short\":\"Mostly Clear\",\"detail\":\"Mostly clear, with a low around 56.\"},{\"name\":\"Friday\",\"start\":\"2026-10-16T06:00:00-04:00\",\"end\":\"2026-10-16T18:00:00-04:00\",\"is_day\":true,\"temp_f\":78,\"temp_low_f\":null,\"precip_pct\":14,\"wind\":\"3 to 9 mph SW\",\"short\":\"Sunny\",\"detail\":\"Sunny, with a high near 78.\"},{\"name\":\"Friday Night\",\"start\":\"2026-10-16T18:00:00-04:00\",\"end\":\"2026-10-17T06:00:00-04:00\",\"is_day\":false,\"temp_f\":54,\"temp_low_f\":null,\"precip_pct\":14,\"wind\":\"5 to 8 mph SW\",\"short\":\"Mostly Clear\",\"detail\":\"Mostly clear, with a low around 54.\"}]}'),
(1056, 6, 'nws', '2026-10-10 17:30:04', '{\"source\":\"nws\",\"generated_at\":\"2026-10-10T11:10:29+00:00\",\"periods\":[{\"name\":\"Today\",\"start\":\"2026-10-10T07:00:00-04:00\",\"end\":\"2026-10-10T18:00:00-04:00\",\"is_day\":true,\"temp_f\":68,\"temp_low_f\":null,\"precip_pct\":89,\"wind\":\"9 to 14 mph E\",\"short\":\"Light Rain Likely\",\"detail\":\"Rain likely before 2pm, then rain showers. Cloudy, with a high near 68. East wind 9 to 14 mph, with gusts as high as 28 mph. Chance of precipitation is 90%. New rainfall amounts between a quarter and half of an inch possible.\"},{\"name\":\"Tonight\",\"start\":\"2026-10-10T18:00:00-04:00\",\"end\":\"2026-10-11T06:00:00-04:00\",\"is_day\":false,\"temp_f\":65,\"temp_low_f\":null,\"precip_pct\":100,\"wind\":\"10 to 16 mph E\",\"short\":\"Rain Showers\",\"detail\":\"Rain showers before 1am, then showers and thunderstorms. Cloudy, with a low around 65. East wind 10 to 16 mph, with gusts as high as 28 mph. Chance of precipitation is 100%. New rainfall amounts between a half and three quarters of an inch possible.\"},{\"name\":\"Sunday\",\"start\":\"2026-10-11T06:00:00-04:00\",\"end\":\"2026-10-11T18:00:00-04:00\",\"is_day\":true,\"temp_f\":79,\"temp_low_f\":null,\"precip_pct\":69,\"wind\":\"9 to 13 mph SE\",\"short\":\"Showers And Thunderstorms Likely\",\"detail\":\"Showers and thunderstorms likely. Mostly cloudy, with a high near 79. Southeast wind 9 to 13 mph, with gusts as high as 22 mph. Chance of precipitation is 70%. New rainfall amounts between a half and three quarters of an inch possible.\"},{\"name\":\"Sunday Night\",\"start\":\"2026-10-11T18:00:00-04:00\",\"end\":\"2026-10-12T06:00:00-04:00\",\"is_day\":false,\"temp_f\":64,\"temp_low_f\":null,\"precip_pct\":60,\"wind\":\"7 to 12 mph SW\",\"short\":\"Rain Showers Likely then Partly Cloudy\",\"detail\":\"Rain showers likely before 8pm. Partly cloudy, with a low around 64. Southwest wind 7 to 12 mph, with gusts as high as 21 mph. Chance of precipitation is 60%. New rainfall amounts between a tenth and quarter of an inch possible.\"},{\"name\":\"Columbus Day\",\"start\":\"2026-10-12T06:00:00-04:00\",\"end\":\"2026-10-12T18:00:00-04:00\",\"is_day\":true,\"temp_f\":80,\"temp_low_f\":null,\"precip_pct\":1,\"wind\":\"12 mph W\",\"short\":\"Sunny\",\"detail\":\"Sunny, with a high near 80. West wind around 12 mph, with gusts as high as 21 mph.\"},{\"name\":\"Monday Night\",\"start\":\"2026-10-12T18:00:00-04:00\",\"end\":\"2026-10-13T06:00:00-04:00\",\"is_day\":false,\"temp_f\":59,\"temp_low_f\":null,\"precip_pct\":1,\"wind\":\"2 to 8 mph NW\",\"short\":\"Mostly Clear\",\"detail\":\"Mostly clear, with a low around 59.\"},{\"name\":\"Tuesday\",\"start\":\"2026-10-13T06:00:00-04:00\",\"end\":\"2026-10-13T18:00:00-04:00\",\"is_day\":true,\"temp_f\":85,\"temp_low_f\":null,\"precip_pct\":0,\"wind\":\"2 to 6 mph W\",\"short\":\"Sunny\",\"detail\":\"Sunny, with a high near 85.\"},{\"name\":\"Tuesday Night\",\"start\":\"2026-10-13T18:00:00-04:00\",\"end\":\"2026-10-14T06:00:00-04:00\",\"is_day\":false,\"temp_f\":64,\"temp_low_f\":null,\"precip_pct\":2,\"wind\":\"6 mph W\",\"short\":\"Clear\",\"detail\":\"Clear, with a low around 64.\"},{\"name\":\"Wednesday\",\"start\":\"2026-10-14T06:00:00-04:00\",\"end\":\"2026-10-14T18:00:00-04:00\",\"is_day\":true,\"temp_f\":81,\"temp_low_f\":null,\"precip_pct\":2,\"wind\":\"6 mph NW\",\"short\":\"Sunny\",\"detail\":\"Sunny, with a high near 81.\"},{\"name\":\"Wednesday Night\",\"start\":\"2026-10-14T18:00:00-04:00\",\"end\":\"2026-10-15T06:00:00-04:00\",\"is_day\":false,\"temp_f\":58,\"temp_low_f\":null,\"precip_pct\":2,\"wind\":\"6 mph N\",\"short\":\"Mostly Clear\",\"detail\":\"Mostly clear, with a low around 58.\"},{\"name\":\"Thursday\",\"start\":\"2026-10-15T06:00:00-04:00\",\"end\":\"2026-10-15T18:00:00-04:00\",\"is_day\":true,\"temp_f\":75,\"temp_low_f\":null,\"precip_pct\":6,\"wind\":\"6 mph E\",\"short\":\"Sunny\",\"detail\":\"Sunny, with a high near 75.\"},{\"name\":\"Thursday Night\",\"start\":\"2026-10-15T18:00:00-04:00\",\"end\":\"2026-10-16T06:00:00-04:00\",\"is_day\":false,\"temp_f\":57,\"temp_low_f\":null,\"precip_pct\":6,\"wind\":\"6 mph SE\",\"short\":\"Mostly Clear\",\"detail\":\"Mostly clear, with a low around 57.\"},{\"name\":\"Friday\",\"start\":\"2026-10-16T06:00:00-04:00\",\"end\":\"2026-10-16T18:00:00-04:00\",\"is_day\":true,\"temp_f\":77,\"temp_low_f\":null,\"precip_pct\":12,\"wind\":\"6 to 9 mph SW\",\"short\":\"Sunny\",\"detail\":\"Sunny, with a high near 77.\"},{\"name\":\"Friday Night\",\"start\":\"2026-10-16T18:00:00-04:00\",\"end\":\"2026-10-17T06:00:00-04:00\",\"is_day\":false,\"temp_f\":55,\"temp_low_f\":null,\"precip_pct\":24,\"wind\":\"7 to 10 mph SW\",\"short\":\"Slight Chance Rain Showers\",\"detail\":\"A slight chance of rain showers between 8pm and 2am. Partly cloudy, with a low around 55.\"}]}'),
-- --------------------------------------------------------
--
-- Table structure for table `wx_locations`
--
CREATE TABLE `wx_locations` (
  `id` int(10) UNSIGNED NOT NULL,
  `label` varchar(80) NOT NULL DEFAULT '',
  `nickname` varchar(40) NOT NULL,
  `zip` char(5) NOT NULL,
  `lat` decimal(9,6) NOT NULL,
  `lon` decimal(9,6) NOT NULL,
  `tz` varchar(64) DEFAULT NULL,
  `nws_json` mediumtext DEFAULT NULL,
  `is_default` tinyint(1) NOT NULL DEFAULT 0,
  `enabled` tinyint(1) NOT NULL DEFAULT 1,
  `sort_order` int(11) NOT NULL DEFAULT 0,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
--
-- Dumping data for table `wx_locations`
--
INSERT INTO `wx_locations` (`id`, `label`, `nickname`, `zip`, `lat`, `lon`, `tz`, `nws_json`, `is_default`, `enabled`, `sort_order`, `created_at`, `updated_at`) VALUES
(5, 'West End, NC', 'home', '27376', 35.251200, -79.536000, 'America/New_York', '{\"grid\":\"RAH/45,30\",\"forecast_url\":\"https://api.weather.gov/gridpoints/RAH/45,30/forecast\",\"hourly_url\":\"https://api.weather.gov/gridpoints/RAH/45,30/forecast/hourly\",\"stations\":[\"KSOP\",\"KHFF\",\"KRCZ\",\"KPOB\",\"KSCR\"],\"county\":\"https://api.weather.gov/zones/county/NCC125\",\"zone\":\"https://api.weather.gov/zones/forecast/NCZ075\",\"city\":\"Seven Lakes\",\"state\":\"NC\",\"resolved_at\":\"2026-10-10 15:28:22\"}', 1, 1, 0, '2026-10-10 15:28:21', '2026-10-10 15:28:22'),
(6, 'Raleigh, NC', 'Raleigh', '27617', 35.903400, -78.744700, 'America/New_York', '{\"grid\":\"RAH/70,62\",\"forecast_url\":\"https://api.weather.gov/gridpoints/RAH/70,62/forecast\",\"hourly_url\":\"https://api.weather.gov/gridpoints/RAH/70,62/forecast/hourly\",\"stations\":[\"KRDU\",\"KLHZ\",\"KTTA\",\"KTDF\",\"KJNX\"],\"county\":\"https://api.weather.gov/zones/county/NCC183\",\"zone\":\"https://api.weather.gov/zones/forecast/NCZ041\",\"city\":\"Raleigh\",\"state\":\"NC\",\"resolved_at\":\"2026-10-10 15:36:05\"}', 0, 1, 1, '2026-10-10 15:36:04', '2026-10-10 15:36:05'),
(27, 'Bayonne, NJ', 'Bayonne', '07002', 40.666400, -74.119200, 'America/New_York', '{\"grid\":\"OKX/30,39\",\"forecast_url\":\"https://api.weather.gov/gridpoints/OKX/30,39/forecast\",\"hourly_url\":\"https://api.weather.gov/gridpoints/OKX/30,39/forecast/hourly\",\"stations\":[\"KEWR\",\"KNYC\",\"KTEB\",\"KLGA\",\"KCDW\"],\"county\":\"https://api.weather.gov/zones/county/NJC017\",\"zone\":\"https://api.weather.gov/zones/forecast/NJZ006\",\"city\":\"Bayonne\",\"state\":\"NJ\",\"resolved_at\":\"2026-10-11 22:03:37\"}', 0, 1, 4, '2026-10-11 22:03:36', '2026-10-11 22:03:37'),
(28, 'Beverly Hills, CA', 'Beverly', '90210', 34.090100, -118.406500, 'America/Los_Angeles', '{\"grid\":\"LOX/149,48\",\"forecast_url\":\"https://api.weather.gov/gridpoints/LOX/149,48/forecast\",\"hourly_url\":\"https://api.weather.gov/gridpoints/LOX/149,48/forecast/hourly\",\"stations\":[\"KSMO\",\"KBUR\",\"KVNY\",\"FHMC1\",\"TPGC1\"],\"county\":\"https://api.weather.gov/zones/county/CAC037\",\"zone\":\"https://api.weather.gov/zones/forecast/CAZ368\",\"city\":\"Beverly Hills\",\"state\":\"CA\",\"resolved_at\":\"2026-10-11 22:21:29\"}', 0, 1, 3, '2026-10-11 22:21:28', '2026-10-11 22:21:29');
-- --------------------------------------------------------
--
-- Table structure for table `wx_location_sources`
--
CREATE TABLE `wx_location_sources` (
  `location_id` int(10) UNSIGNED NOT NULL,
  `source_id` varchar(32) NOT NULL,
  `priority` int(11) NOT NULL DEFAULT 50,
  `max_age_min` int(11) NOT NULL DEFAULT 60,
  `enabled` tinyint(1) NOT NULL DEFAULT 1
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
--
-- Dumping data for table `wx_location_sources`
--
INSERT INTO `wx_location_sources` (`location_id`, `source_id`, `priority`, `max_age_min`, `enabled`) VALUES
(5, 'nws', 20, 90, 1),
(5, 'openmeteo', 30, 45, 1),
(6, 'nws', 20, 90, 1),
(6, 'openmeteo', 30, 45, 1),
(27, 'nws', 20, 90, 1),
(27, 'openmeteo', 30, 45, 1),
(28, 'nws', 20, 90, 1),
(28, 'openmeteo', 30, 45, 1);
-- --------------------------------------------------------
--
-- Table structure for table `wx_migrations`
--
CREATE TABLE `wx_migrations` (
  `name` varchar(100) NOT NULL,
  `applied_at` datetime NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;
--
-- Dumping data for table `wx_migrations`
--
INSERT INTO `wx_migrations` (`name`, `applied_at`) VALUES
('001_schema.sql', '2026-10-08 18:45:44');
-- --------------------------------------------------------
--
-- Table structure for table `wx_observations`
--
CREATE TABLE `wx_observations` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `location_id` int(10) UNSIGNED NOT NULL,
  `source_id` varchar(32) NOT NULL,
  `observed_at` datetime NOT NULL,
  `received_at` datetime NOT NULL,
  `station_id` varchar(40) DEFAULT NULL,
  `temp_c` double DEFAULT NULL,
  `feels_like_c` double DEFAULT NULL,
  `humidity_pct` double DEFAULT NULL,
  `dew_point_c` double DEFAULT NULL,
  `wind_speed_ms` double DEFAULT NULL,
  `wind_gust_ms` double DEFAULT NULL,
  `wind_dir_deg` double DEFAULT NULL,
  `pressure_hpa` double DEFAULT NULL,
  `precip_rate_mm_hr` double DEFAULT NULL,
  `precip_today_mm` double DEFAULT NULL,
  `uv_index` double DEFAULT NULL,
  `solar_wm2` double DEFAULT NULL,
  `lightning_count_1h` int(11) DEFAULT NULL,
  `lightning_last_km` double DEFAULT NULL,
  `visibility_km` double DEFAULT NULL,
  `cloud_cover_pct` double DEFAULT NULL,
  `sky_text` varchar(120) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
--
-- Dumping data for table `wx_observations`
--
INSERT INTO `wx_observations` (`id`, `location_id`, `source_id`, `observed_at`, `received_at`, `station_id`, `temp_c`, `feels_like_c`, `humidity_pct`, `dew_point_c`, `wind_speed_ms`, `wind_gust_ms`, `wind_dir_deg`, `pressure_hpa`, `precip_rate_mm_hr`, `precip_today_mm`, `uv_index`, `solar_wm2`, `lightning_count_1h`, `lightning_last_km`, `visibility_km`, `cloud_cover_pct`, `sky_text`) VALUES
(921, 5, 'nws', '2026-10-10 15:05:00', '2026-10-10 15:30:01', 'KSOP', 18, 18, 93.884545007364, 17, 5.14, NULL, 70, 1023.028, NULL, NULL, NULL, NULL, NULL, NULL, 16.09344, NULL, 'Mostly Cloudy'),
(922, 5, 'openmeteo', '2026-10-10 15:30:00', '2026-10-10 15:40:03', 'model', 18, 16.9, 81, 14.688545909337, 5.19, 12.3, 62, 1021.9, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 100, 'Overcast'),
(923, 5, 'nws', '2026-10-10 15:15:00', '2026-10-10 15:35:01', 'KSOP', 18, 18, 93.884545007364, 17, 5.66, NULL, 70, 1022.6894, NULL, NULL, NULL, NULL, NULL, NULL, 16.09344, NULL, 'Cloudy'),
(925, 5, 'nws', '2026-10-10 15:20:00', '2026-10-10 15:45:02', 'KSOP', 18, 18, 93.884545007364, 17, 5.66, NULL, 70, 1022.6894, NULL, NULL, NULL, NULL, NULL, NULL, 16.09344, NULL, 'Cloudy'),
(3800, 27, 'nws', '2026-10-12 04:20:00', '2026-10-12 04:35:09', 'KEWR', 13, 13, 93.65072411462, 12, 5.66, NULL, 10, 1010.1598, NULL, NULL, NULL, NULL, NULL, NULL, 14.4841, NULL, 'Cloudy');
-- --------------------------------------------------------
--
-- Table structure for table `wx_settings`
--
CREATE TABLE `wx_settings` (
  `k` varchar(64) NOT NULL,
  `v` text DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
--
-- Dumping data for table `wx_settings`
--
INSERT INTO `wx_settings` (`k`, `v`) VALUES
('last_purge_at', '2026-10-11 21:40:07'),
('selftest_e70e6e49', 'x');
-- --------------------------------------------------------
--
-- Table structure for table `wx_sources`
--
CREATE TABLE `wx_sources` (
  `id` varchar(32) NOT NULL,
  `name` varchar(80) NOT NULL,
  `enabled` tinyint(1) NOT NULL DEFAULT 1,
  `config_json` text DEFAULT NULL,
  `last_success_at` datetime DEFAULT NULL,
  `last_error_at` datetime DEFAULT NULL,
  `last_error` varchar(500) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
--
-- Dumping data for table `wx_sources`
--
INSERT INTO `wx_sources` (`id`, `name`, `enabled`, `config_json`, `last_success_at`, `last_error_at`, `last_error`) VALUES
('nws', 'National Weather Service', 1, NULL, '2026-10-12 04:35:10', NULL, NULL),
('openmeteo', 'Open-Meteo', 1, NULL, '2026-10-12 04:35:11', '2026-10-11 20:40:35', 'current: Operation timed out after 10003 milliseconds with 0 bytes received');
--
-- Indexes for dumped tables
--
--
-- Indexes for table `wx_alerts_active`
--
ALTER TABLE `wx_alerts_active`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `uq_wx_alert` (`location_id`,`external_id`);
--
-- Indexes for table `wx_audit_log`
--
ALTER TABLE `wx_audit_log`
  ADD PRIMARY KEY (`id`),
  ADD KEY `ix_wx_audit_at` (`at`);
--
-- Indexes for table `wx_forecasts`
--
ALTER TABLE `wx_forecasts`
  ADD PRIMARY KEY (`id`),
  ADD KEY `ix_wx_fc` (`location_id`,`source_id`,`fetched_at`);
--
-- Indexes for table `wx_locations`
--
ALTER TABLE `wx_locations`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `uq_wx_loc_nick` (`nickname`);
--
-- Indexes for table `wx_location_sources`
--
ALTER TABLE `wx_location_sources`
  ADD PRIMARY KEY (`location_id`,`source_id`),
  ADD KEY `fk_wx_ls_src` (`source_id`);
--
-- Indexes for table `wx_migrations`
--
ALTER TABLE `wx_migrations`
  ADD PRIMARY KEY (`name`);
--
-- Indexes for table `wx_observations`
--
ALTER TABLE `wx_observations`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `uq_wx_obs` (`location_id`,`source_id`,`observed_at`),
  ADD KEY `ix_wx_obs_loc_time` (`location_id`,`observed_at`);
--
-- Indexes for table `wx_settings`
--
ALTER TABLE `wx_settings`
  ADD PRIMARY KEY (`k`);
--
-- Indexes for table `wx_sources`
--
ALTER TABLE `wx_sources`
  ADD PRIMARY KEY (`id`);
--
-- AUTO_INCREMENT for dumped tables
--
--
-- AUTO_INCREMENT for table `wx_alerts_active`
--
ALTER TABLE `wx_alerts_active`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=673;
--
-- AUTO_INCREMENT for table `wx_audit_log`
--
ALTER TABLE `wx_audit_log`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=40;
--
-- AUTO_INCREMENT for table `wx_forecasts`
--
ALTER TABLE `wx_forecasts`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3793;
--
-- AUTO_INCREMENT for table `wx_locations`
--
ALTER TABLE `wx_locations`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=29;
--
-- AUTO_INCREMENT for table `wx_observations`
--
ALTER TABLE `wx_observations`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3802;
--
-- Constraints for dumped tables
--
--
-- Constraints for table `wx_alerts_active`
--
ALTER TABLE `wx_alerts_active`
  ADD CONSTRAINT `fk_wx_al_loc` FOREIGN KEY (`location_id`) REFERENCES `wx_locations` (`id`) ON DELETE CASCADE;
--
-- Constraints for table `wx_forecasts`
--
ALTER TABLE `wx_forecasts`
  ADD CONSTRAINT `fk_wx_fc_loc` FOREIGN KEY (`location_id`) REFERENCES `wx_locations` (`id`) ON DELETE CASCADE;
--
-- Constraints for table `wx_location_sources`
--
ALTER TABLE `wx_location_sources`
  ADD CONSTRAINT `fk_wx_ls_loc` FOREIGN KEY (`location_id`) REFERENCES `wx_locations` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `fk_wx_ls_src` FOREIGN KEY (`source_id`) REFERENCES `wx_sources` (`id`) ON DELETE CASCADE;
--
-- Constraints for table `wx_observations`
--
ALTER TABLE `wx_observations`
  ADD CONSTRAINT `fk_wx_obs_loc` FOREIGN KEY (`location_id`) REFERENCES `wx_locations` (`id`) ON DELETE CASCADE;
COMMIT;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
