-- Create feeds table
CREATE TABLE feeds (
    feed_id TEXT PRIMARY KEY NOT NULL,
    name TEXT NOT NULL,
    url TEXT NOT NULL,
    user_id TEXT NOT NULL,
    added_time TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
    last_checked_time TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
    FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE
);

-- Create indexes
CREATE INDEX feeds_user_id_idx ON feeds(user_id);
CREATE UNIQUE INDEX feeds_user_url_idx ON feeds(user_id, url); 