SoXX
c120c583e3
All checks were successful
Gitea Build Check / Build (push) Successful in 2m56s
- added migration - added model
28 lines
782 B
SQL
28 lines
782 B
SQL
-- +migrate Up
|
|
CREATE TYPE pool_category AS ENUM ('series', 'collection');
|
|
|
|
CREATE TABLE "Pool"
|
|
(
|
|
id CHAR(25) PRIMARY KEY,
|
|
name VARCHAR(75),
|
|
created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
|
updated_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
|
deleted_at TIMESTAMP NULL,
|
|
category POOL_CATEGORY NOT NULL
|
|
);
|
|
|
|
CREATE TABLE "PoolPost"
|
|
(
|
|
pool_id CHAR(25) REFERENCES "Pool" (id),
|
|
post_id CHAR(25) REFERENCES "Post" (id),
|
|
order_position INT NOT NULL DEFAULT 0,
|
|
PRIMARY KEY (pool_id, post_id)
|
|
);
|
|
|
|
CREATE TABLE "PoolReference"
|
|
(
|
|
pool_id CHAR(25) REFERENCES "Pool" (id),
|
|
source_id CHAR(25) REFERENCES "Source" (id),
|
|
url TEXT NOT NULL,
|
|
PRIMARY KEY (pool_id, source_id, url)
|
|
); |