Adds migrations for new models

This commit is contained in:
Dennis Schoepf 2024-05-14 22:52:34 +02:00
parent 96fc234068
commit 5a75fd94bb
3 changed files with 25 additions and 1 deletions

View file

@ -6,4 +6,4 @@ CREATE table user (
); );
-- +migrate Down -- +migrate Down
DROP TABLE users; DROP TABLE user;

View file

@ -0,0 +1,11 @@
-- +migrate Up
CREATE table feed (
id INTEGER PRIMARY KEY,
name text NOT NULL,
url text NOT NULL UNIQUE,
userId text NOT NULL,
FOREIGN KEY (userId) REFERENCES user(id)
);
-- +migrate Down
DROP TABLE feed;

View file

@ -0,0 +1,13 @@
-- +migrate Up
CREATE table article (
id INTEGER PRIMARY KEY,
name text NOT NULL,
url text NOT NULL UNIQUE,
read INTEGER DEFAULT 0,
readAt text,
feedId INTEGER,
FOREIGN KEY (feedId) REFERENCES feed(id)
);
-- +migrate Down
DROP TABLE article;