import org.breezyweather.unit.precipitation.Precipitation;

CREATE TABLE minutelys(
    _id INTEGER NOT NULL PRIMARY KEY,
    location_formatted_id TEXT NOT NULL,

    date INTEGER NOT NULL,
    minute_interval INTEGER NOT NULL,
    precipitation_intensity INTEGER AS Precipitation,

    FOREIGN KEY(location_formatted_id) REFERENCES locations (formatted_id)
    ON DELETE CASCADE
);

CREATE INDEX minutelys_location_formatted_id_index ON minutelys(location_formatted_id);

getMinutelyListByLocationId:
SELECT date, minute_interval, precipitation_intensity
FROM minutelys
WHERE location_formatted_id = :locationFormattedId
ORDER BY date;

insert:
INSERT INTO minutelys(location_formatted_id, date, minute_interval, precipitation_intensity)
VALUES (:locationFormattedId, :date, :minuteInterval, :precipitationIntensity);

deleteMinutelyListForLocationId:
DELETE FROM minutelys
WHERE location_formatted_id = :locationFormattedId;
