#7 - saving feed, but without content
This commit is contained in:
11
sql/queries/createFeed.sql
Normal file
11
sql/queries/createFeed.sql
Normal file
@@ -0,0 +1,11 @@
|
||||
-- name: CreateFeed :one
|
||||
INSERT INTO feeds (id, created_at, updated_at, user_id, url, name)
|
||||
VALUES (
|
||||
$1,
|
||||
$2,
|
||||
$3,
|
||||
$4,
|
||||
$5,
|
||||
$6
|
||||
)
|
||||
RETURNING *;
|
||||
12
sql/schema/0002_feed.sql
Normal file
12
sql/schema/0002_feed.sql
Normal file
@@ -0,0 +1,12 @@
|
||||
-- +goose Up
|
||||
CREATE TABLE feeds(
|
||||
id UUID PRIMARY KEY,
|
||||
created_at TIMESTAMP not null DEFAULT CURRENT_TIMESTAMP,
|
||||
updated_at TIMESTAMP not null,
|
||||
name VARCHAR(128) not null,
|
||||
url VARCHAR(512) not null UNIQUE,
|
||||
user_id UUID not null REFERENCES users(id) ON DELETE CASCADE
|
||||
);
|
||||
|
||||
-- +goose Down
|
||||
DROP TABLE feeds;
|
||||
Reference in New Issue
Block a user