mirror of
https://github.com/zoriya/Kyoo.git
synced 2025-06-01 04:34:50 -04:00
Create request migration
This commit is contained in:
parent
00f0ec44e4
commit
8da4e5e840
7
scanner/migrations/000001_request.down.sql
Normal file
7
scanner/migrations/000001_request.down.sql
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
begin;
|
||||||
|
|
||||||
|
drop table scanner.requests;
|
||||||
|
drop type scanner.request_kind;
|
||||||
|
|
||||||
|
commit;
|
||||||
|
|
18
scanner/migrations/000001_request.up.sql
Normal file
18
scanner/migrations/000001_request.up.sql
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
begin;
|
||||||
|
|
||||||
|
create type scanner.request_kind as enum('episode', 'movie');
|
||||||
|
|
||||||
|
create table scanner.requests(
|
||||||
|
pk serial primary key,
|
||||||
|
id uuid not null default gen_random_uuid() unique,
|
||||||
|
kind scanner.request_kind not null,
|
||||||
|
title text not null,
|
||||||
|
year integer,
|
||||||
|
external_id jsonb not null default '{}'::jsonb,
|
||||||
|
|
||||||
|
created_at timestamptz not null default now()::timestamptz,
|
||||||
|
|
||||||
|
constraint unique_kty (kind, title, year)
|
||||||
|
);
|
||||||
|
|
||||||
|
commit;
|
@ -8,6 +8,7 @@
|
|||||||
watchfiles
|
watchfiles
|
||||||
langcodes
|
langcodes
|
||||||
psycopg
|
psycopg
|
||||||
|
psycopg-pool
|
||||||
]);
|
]);
|
||||||
in
|
in
|
||||||
pkgs.mkShell {
|
pkgs.mkShell {
|
||||||
@ -15,5 +16,6 @@ in
|
|||||||
python
|
python
|
||||||
ruff
|
ruff
|
||||||
fastapi-cli
|
fastapi-cli
|
||||||
|
pgformatter
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user