album/db/00001_init.sql
Rasmus Kaj 19db2ca293 Add support for places.
Only the simple tag-like places I used in kphotoalbum.
Proper geotagging is still left to do.
2015-11-29 22:38:47 +01:00

37 lines
1000 B
SQL

create table public.photo (
id serial primary key,
path varchar(100) unique not null,
grade smallint,
rotation smallint not null
);
create table public.tag (
id serial primary key,
tag varchar(100) unique not null,
slug varchar(100) unique not null
);
create table public.photo_tag (
photo integer not null references public.photo (id),
tag integer not null references public.tag (id)
);
create table public.person (
id serial primary key,
name varchar(100) unique not null,
slug varchar(100) unique not null
);
create table public.photo_person (
photo integer not null references public.photo (id),
person integer not null references public.person (id)
);
create table public.place (
id serial primary key,
place varchar(100) unique not null,
slug varchar(100) unique not null
);
create table public.photo_place (
photo integer not null references public.photo (id),
place integer not null references public.place (id)
);