(Also, "books" already exists as part of the Bible API.)
This commit is contained in:
Benjamin A. Shelton 2026-11-11 15:36:57 -07:00
commit fd63b2473b
Signed by: zancarius
GPG key ID: 8BD42DBD6C337E01

View file

@ -1,6 +1,6 @@
-- @up
create table books (
create table library_books (
id integer primary key autoincrement,
isbn integer default 0 not null,
-- ISBN-10 check digit. If it is the maximum allowable value in the base-11 format (i.e. the ISBN-10 ends with "X") this will be "1".
@ -17,8 +17,8 @@ create table library (
chatid integer,
available boolean default true not null,
foreign key bookid references books(id)
)
foreign key (bookid) references library_books(id)
);
create unique index bookid_chatid_library_idx on library(bookid, chatid);
create table library_checkout (
@ -46,7 +46,6 @@ create table library_queue (
foreign key (bookid) references library_books(id),
foreign key (userid) references users(id)
);
create index library_queue_bookid_idx on library_queue (bookid);
@ -68,7 +67,7 @@ create table ol_cache (
requested datetime default current_timestamp not null,
-- We cache the full response for later debugging, if needed.
json_response text default '' not null,
json_response text default '' not null
);
create unique index ol_cache_isbn_idx on ol_cache(isbn);