album/db/00001_init.sql

38 lines
1.0 KiB
MySQL
Raw Normal View History

create table public.photo (
2015-11-29 20:34:54 +03:00
id serial primary key,
path varchar(100) unique not null,
2015-12-22 20:22:21 +03:00
date timestamp with time zone,
2015-11-29 22:06:11 +03:00
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)
);
2015-11-29 20:34:54 +03:00
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)
);