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)
);
