mi/backend/migrations/2020-12-22-003510_weather/up.sql

9 lines
220 B
MySQL
Raw Normal View History

CREATE TABLE IF NOT EXISTS weather
( ts TIMESTAMP NOT NULL PRIMARY KEY
, region TEXT NOT NULL
, body BLOB NOT NULL -- JSON-encoded weather data
);
CREATE UNIQUE INDEX weather_ts_region
ON weather(ts, region);