create rss_subscription db table

This commit is contained in:
Hongbo Wu 2023-07-05 16:35:52 +08:00
parent a7773bf00b
commit d9130879d8
2 changed files with 29 additions and 0 deletions

View file

@ -0,0 +1,20 @@
-- Type: DO
-- Name: rss_subscription
-- Description: Create a table for RSS subscriptions
BEGIN;
CREATE TABLE omnivore.rss_subscription (
id uuid PRIMARY KEY DEFAULT uuid_generate_v1mc(),
user_id uuid NOT NULL REFERENCES omnivore.user ON DELETE CASCADE,
title character varying(255) NOT NULL,
description TEXT,
url TEXT NOT NULL,
image_url TEXT,
count integer NOT NULL DEFAULT 0,
last_updated timestamptz,
created_at timestamptz NOT NULL DEFAULT current_timestamp,
updated_at timestamptz NOT NULL DEFAULT current_timestamp,
);
COMMIT;

View file

@ -0,0 +1,9 @@
-- Type: UNDO
-- Name: rss_subscription
-- Description: Create a table for RSS subscriptions
BEGIN;
DROP TABLE IF EXISTS omnivore.rss_subscription;
COMMIT;