Items will now be added when adding feed, add /feed/{id} and improve SQL
This commit is contained in:
parent
7b056a4a41
commit
99cd70165e
14 changed files with 807 additions and 282 deletions
|
|
@ -3,10 +3,10 @@
|
|||
-- Dublin Core for feeds
|
||||
-- https://github.com/mmcdole/gofeed/blob/master/extensions/dublincore.go#L5
|
||||
CREATE TABLE IF NOT EXISTS feed_dublin_cores (
|
||||
id SERIAL PRIMARY KEY,
|
||||
created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
updated_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
deleted_at TIMESTAMP DEFAULT NULL,
|
||||
id BIGINT GENERATED ALWAYS AS IDENTITY PRIMARY KEY,
|
||||
created_at TIMESTAMPTZ NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
updated_at TIMESTAMPTZ NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
deleted_at TIMESTAMPTZ DEFAULT NULL,
|
||||
-- From gofeed:
|
||||
title TEXT [],
|
||||
creator TEXT [],
|
||||
|
|
@ -25,17 +25,17 @@ CREATE TABLE IF NOT EXISTS feed_dublin_cores (
|
|||
coverage TEXT [],
|
||||
rights TEXT [],
|
||||
-- Link to feed
|
||||
feed_id INTEGER NOT NULL,
|
||||
feed_id BIGINT NOT NULL,
|
||||
CONSTRAINT fk_feed_id FOREIGN KEY (feed_id) REFERENCES feeds (id) ON DELETE CASCADE
|
||||
);
|
||||
|
||||
-- Dublin Core for items
|
||||
-- https://github.com/mmcdole/gofeed/blob/master/extensions/dublincore.go#L5
|
||||
CREATE TABLE IF NOT EXISTS item_dublin_cores (
|
||||
id SERIAL PRIMARY KEY,
|
||||
created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
updated_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
deleted_at TIMESTAMP DEFAULT NULL,
|
||||
id BIGINT GENERATED ALWAYS AS IDENTITY PRIMARY KEY,
|
||||
created_at TIMESTAMPTZ NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
updated_at TIMESTAMPTZ NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
deleted_at TIMESTAMPTZ DEFAULT NULL,
|
||||
-- From gofeed:
|
||||
title TEXT [],
|
||||
creator TEXT [],
|
||||
|
|
@ -54,7 +54,7 @@ CREATE TABLE IF NOT EXISTS item_dublin_cores (
|
|||
coverage TEXT [],
|
||||
rights TEXT [],
|
||||
-- Link to feed item (Also called feed entry)
|
||||
item_id INTEGER NOT NULL,
|
||||
item_id BIGINT NOT NULL,
|
||||
CONSTRAINT fk_item_id FOREIGN KEY (item_id) REFERENCES items (id) ON DELETE CASCADE
|
||||
);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue