summaryrefslogtreecommitdiff
path: root/sql/pgsql/schema.sql
blob: 3616f064f60f94666bec021a5dc5fb10379bc37e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
create table if not exists epube_users (
	id serial not null primary key,
	username varchar(100) not null unique,
	pass varchar(200) not null);

create table if not exists epube_pagination (
	id serial not null primary key,
	bookid bigint not null,
	total_pages bigint not null,
	pagination text not null);

create table if not exists epube_books (
	id serial not null primary key,
	bookid bigint not null,
	owner varchar(200) not null not null references epube_users(username) on delete cascade,
	lastts bigint not null,
	lastcfi text not null,
	lastread bigint not null);

create table if not exists epube_favorites(
	id serial not null primary key,
	bookid bigint not null,
	owner varchar(200) not null references epube_users(username) on delete cascade);