gator/sql/postgres/schema/002_feeds.sql
Dan Anglin cfa6a4abad
refactor: move postgres SQL files
Move the postgres SQL schema and query files to sql/postgres.
2024-10-01 06:51:10 +01:00

13 lines
314 B
SQL

-- +goose Up
CREATE TABLE feeds (
id UUID PRIMARY KEY,
created_at TIMESTAMP NOT NULL,
updated_at TIMESTAMP NOT NULL,
name varchar(255) NOT NULL,
url varchar(255) NOT NULL UNIQUE,
user_id UUID NOT NULL,
FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE
);
-- +goose Down
DROP TABLE feeds;