1
0
go-rss-aggregator/sql/schema/004_feed_follows.sql
2023-09-09 14:39:32 +03:00

13 lines
336 B
SQL

-- +goose Up
CREATE TABLE feed_follows (
id INTEGER PRIMARY KEY AUTOINCREMENT,
created_at DATE NOT NULL,
updated_at DATE NOT NULL,
user_id INTEGER NOT NULL REFERENCES users(id) ON DELETE CASCADE,
feed_id INTEGER NOT NULL REFERENCES feeds(id) ON DELETE CASCADE,
UNIQUE(user_id, feed_id)
);
-- +goose Down
DROP TABLE feed_follows;