Add ability to watch an episode

- Migration for new backing table.
- CRUD server functions, new components to display and interact.
This commit is contained in:
Thomas Gideon 2024-09-14 18:33:50 -04:00
parent 75e388555b
commit b2e55008dd
11 changed files with 317 additions and 43 deletions

View file

@ -1,6 +1,12 @@
create table if not exists "public"."series" (
"id" uuid default gen_random_uuid() not null primary key,
"name" text not null,
"created" timestamptz default now() not null,
"updated" timestamptz default now() not null
create table if not exists series (
id uuid default gen_random_uuid() not null primary key,
created timestamptz default now() not null,
updated timestamptz default now() not null,
name text not null,
source text not null check (source in (
'Disney', 'Hulu', 'Paramount', 'Prime', 'Max', 'Netflix', 'Shudder'
)),
source_url text not null,
imdb text null,
wikipedia text null
);

View file

@ -1,4 +0,0 @@
alter table "public"."series" add column source text not null;
alter table "public"."series" add column source_url text not null;
alter table "public"."series" add column imdb text null;
alter table "public"."series" add column wikipedia text null

View file

@ -0,0 +1,9 @@
create table if not exists viewing (
id uuid default gen_random_uuid() not null primary key,
series_id uuid not null references series(id),
created timestamptz default now() not null,
updated timestamptz default now() not null,
season smallint not null check (season > 0),
episode smallint not null check (episode > 0),
"comment" text null
);