Files
boot-dev-blog-aggregator/sql/schema/0003_feed_follows.sql
2025-03-11 14:53:10 +02:00

12 lines
406 B
SQL

-- +goose Up
CREATE TABLE feed_follows(
id UUID PRIMARY KEY,
created_at TIMESTAMP not null DEFAULT CURRENT_TIMESTAMP,
updated_at TIMESTAMP not null,
user_id UUID not null REFERENCES users(id) ON DELETE CASCADE,
feed_id UUID not null REFERENCES feeds(id) ON DELETE CASCADE,
CONSTRAINT UC_User_Feed UNIQUE(user_id, feed_id)
);
-- +goose Down
DROP TABLE feeds;