breezy/data/src/main/sqldelight/breezyweather/migrations/13.sqm
2025-11-21 15:11:39 +01:00

14 lines
440 B
Text

CREATE TABLE normals(
_id INTEGER NOT NULL PRIMARY KEY,
location_formatted_id TEXT NOT NULL,
month INTEGER NOT NULL,
daytime_temperature REAL,
nighttime_temperature REAL,
UNIQUE(location_formatted_id, month) ON CONFLICT REPLACE,
FOREIGN KEY(location_formatted_id) REFERENCES locations (formatted_id)
ON DELETE CASCADE
);
CREATE INDEX normals_location_formatted_id_index ON normals(location_formatted_id);