summaryrefslogtreecommitdiff
path: root/sql/pgsql/schema.sql
diff options
context:
space:
mode:
Diffstat (limited to 'sql/pgsql/schema.sql')
-rw-r--r--sql/pgsql/schema.sql23
1 files changed, 23 insertions, 0 deletions
diff --git a/sql/pgsql/schema.sql b/sql/pgsql/schema.sql
new file mode 100644
index 0000000..3616f06
--- /dev/null
+++ b/sql/pgsql/schema.sql
@@ -0,0 +1,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);