blogdor/migrations/0002_feeds_and_status.up.sql
2026-01-01 17:55:21 -08:00

16 lines
469 B
SQL

CREATE TABLE IF NOT EXISTS feeds (
id INTEGER NOT NULL PRIMARY KEY,
url TEXT NOT NULL,
owner INT NOT NULL,
created DATETIME NOT NULL DEFAULT current_timestamp,
FOREIGN KEY (owner) REFERENCES users(zulip_id),
UNIQUE(url, owner)
);
CREATE TABLE IF NOT EXISTS status (
id INTEGER NOT NULL PRIMARY KEY,
feed INTEGER NOT NULL,
updated DATETIME NOT NULL DEFAULT current_timestamp,
active BOOLEAN NOT NULL DEFAULT FALSE,
FOREIGN KEY (feed) REFERENCES feeds(id)
);