Bible-related tables.
This commit is contained in:
parent
d4167f191c
commit
de7ff83066
1 changed files with 68 additions and 0 deletions
|
|
@ -73,3 +73,71 @@ create table verse_submitters (
|
|||
foreign key (userid) references users(id),
|
||||
primary key (verseid, userid)
|
||||
);
|
||||
|
||||
-- Bible metadata.
|
||||
create table translations (
|
||||
id integer primary key autoincrement,
|
||||
|
||||
-- Translations "code" or ID. For some translations this will be 3 characters. Others may use a longer identifier.
|
||||
code text not null,
|
||||
|
||||
-- Helloao endpoint for this translation.
|
||||
api_endpoint text not null,
|
||||
|
||||
title text not null
|
||||
|
||||
primary key (id)
|
||||
);
|
||||
create unique index translations_code_idx on translations(code);
|
||||
|
||||
create table books (
|
||||
id integer primary key autoincrement,
|
||||
|
||||
translationid integer not null,
|
||||
|
||||
-- 3 letter book ID/code.
|
||||
code text not null,
|
||||
|
||||
chapter_count integer default 0 not null,
|
||||
verse_count integer default 0 not null,
|
||||
apocrypha boolean default false not null,
|
||||
|
||||
-- 0 = no Testament (apocryphal, pseudepigraphical)
|
||||
-- 1 = Old Testament
|
||||
-- 2 = New Testament
|
||||
-- 3 = other
|
||||
testament integer default 0 not null,
|
||||
|
||||
-- 0 = default variant reading (OT = Masoretic Text, NT = Alexandrian)
|
||||
-- 1 = alternate reading #1 (OT = DSS, NT = Byzantine/Majority Text)
|
||||
-- 2 = alternate reading #2 (OT = LXX, NT = Western/Latin)
|
||||
variant integer default 0 not null,
|
||||
|
||||
foreign key (translationid) references translations(id),
|
||||
|
||||
primary key (id)
|
||||
);
|
||||
create unique index books_code_idx on books(code);
|
||||
|
||||
create table chapters (
|
||||
id integer primary key autoincrement,
|
||||
num integer default 0 not null,
|
||||
bookid integer default 0 not null,
|
||||
verse_count integer default 0 not null,
|
||||
|
||||
-- Mapping code is used to adjust the chapter count, such as for the Septuagint. Mapping codes currently only function for adjusting the chapter count to adjust for the Masoretic Text reading.
|
||||
mapping_code integer default 0 not null,
|
||||
|
||||
foreign key (bookid) references book(id),
|
||||
|
||||
primary key (id)
|
||||
);
|
||||
create unique index chapters_id_num_idx on chapters(id, num);
|
||||
|
||||
create table verses (
|
||||
id integer primary key autoincrement,
|
||||
chapterid integer not null,
|
||||
num integer default 0 not null,
|
||||
foreign key (chapterid) references chapters(id),
|
||||
primary key (id)
|
||||
);
|
||||
Loading…
Reference in a new issue