11 lines
334 B
SQL
11 lines
334 B
SQL
CREATE TABLE weather_cache (
|
|
id SERIAL PRIMARY KEY,
|
|
location VARCHAR(100) NOT NULL,
|
|
temperature_c NUMERIC NOT NULL,
|
|
condition_code INTEGER NOT NULL,
|
|
condition_text VARCHAR(100) NOT NULL,
|
|
fetched_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
|
|
);
|
|
|
|
CREATE INDEX idx_weather_cache_fetched_at ON weather_cache(fetched_at);
|