summaryrefslogtreecommitdiff
path: root/sql/pgsql/schema.sql
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2024-02-18 12:34:17 +0300
committerAndrew Dolgov <[email protected]>2024-02-18 12:34:56 +0300
commiteb52a7da8e2cafa1892d3f8810a69435b7a9b854 (patch)
tree286a54c4ea0d153fb31ce69edb0b8233e8046934 /sql/pgsql/schema.sql
parent19b3e7fff80d430a9f287138f9cf84a1faa681fd (diff)
add pgsql support
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);