Link Ground Zero weather lookup coordinates

This commit is contained in:
2026-05-16 02:09:11 -07:00
parent 08a1df6ebe
commit a7292bbae1
10 changed files with 217 additions and 10 deletions
+13
View File
@@ -64,6 +64,19 @@ CREATE TABLE IF NOT EXISTS terrain_tile_growing_season_metadata (
FOREIGN KEY (tile_id) REFERENCES terrain_tiles(tile_id)
);
CREATE TABLE IF NOT EXISTS terrain_tile_weather_lookup_metadata (
tile_id TEXT PRIMARY KEY,
lookup_latitude REAL NOT NULL CHECK (lookup_latitude >= -90 AND lookup_latitude <= 90),
lookup_longitude REAL NOT NULL CHECK (lookup_longitude >= -180 AND lookup_longitude <= 180),
coordinate_source TEXT NOT NULL CHECK (coordinate_source IN ('tile_center', 'manual_override', 'provider_grid_point')),
primary_provider TEXT NOT NULL DEFAULT 'open-meteo',
fallback_provider TEXT NOT NULL DEFAULT '',
fallback_provider_eligible INTEGER NOT NULL DEFAULT 0 CHECK (fallback_provider_eligible IN (0, 1)),
lookup_rule TEXT NOT NULL DEFAULT '',
generated_at TEXT NOT NULL DEFAULT CURRENT_TIMESTAMP,
FOREIGN KEY (tile_id) REFERENCES terrain_tiles(tile_id)
);
CREATE TABLE IF NOT EXISTS terrain_tile_neighbors (
tile_id TEXT NOT NULL,
direction TEXT NOT NULL CHECK (direction IN ('n', 'ne', 'e', 'se', 's', 'sw', 'w', 'nw')),