what2watch/migrations/20240116054253_stars_and_credits.up.sql

21 lines
643 B
MySQL
Raw Normal View History

2024-01-17 04:21:38 +00:00
create table if not exists stars (
id blob not null primary key default (julid_new()),
name text not null,
metadata_url text,
born int,
died int
);
create index if not exists stars_name_dex on stars (lower(name));
-- as in screen credits for a movie
create table if not exists credits (
star blob not null,
watch blob not null,
credit text, -- "actor", "director", whatevs
unique (star, watch, credit),
foreign key (star) references stars (id),
foreign key (watch) references watches (id)
);
create index if not exists credits_star_dex on credits (star);
create index if not exists credits_watch_dex on credits (watch);