Add verse log and birthdays.
This commit is contained in:
parent
29d003cb63
commit
a4cdfdad06
1 changed files with 32 additions and 0 deletions
|
|
@ -4,6 +4,7 @@ create table chats (
|
|||
id integer primary key,
|
||||
name text not null
|
||||
) strict;
|
||||
insert into chats values (1, 'all chats');
|
||||
|
||||
create table chat_config (
|
||||
chatid integer,
|
||||
|
|
@ -157,6 +158,37 @@ create table scheduled_verses (
|
|||
primary key (verseid, chatid, translationid)
|
||||
);
|
||||
|
||||
create table verses_log (
|
||||
verseid integer not null,
|
||||
chatid integer not null,
|
||||
translationid integer not null,
|
||||
posted date default now,
|
||||
|
||||
foreign key (verseid) references verses(id),
|
||||
foreign key (chatid) references chat(id),
|
||||
foreign key (translationid) references translations(id),
|
||||
|
||||
primary key (verseid, chatid, translationid)
|
||||
);
|
||||
|
||||
create table birthdays (
|
||||
userid integer not null,
|
||||
chatid integer not null,
|
||||
|
||||
month integer not null,
|
||||
day integer not null,
|
||||
|
||||
-- If the birthday falls on a leap year and is February 29th, offer the user
|
||||
-- an opportunity to apply an adjustment of either -1 (February 28th) or +1
|
||||
-- (March 1st).
|
||||
leap_adjust integer not null,
|
||||
|
||||
foreign key (userid) references users(id),
|
||||
foreign key (chatid) references chats(id),
|
||||
|
||||
primary key (userid, chatid)
|
||||
);
|
||||
|
||||
-- Enable with PRAGMA foreign_keys = ON;
|
||||
|
||||
create table books (
|
||||
|
|
|
|||
Loading…
Reference in a new issue