Add verse log and birthdays.

This commit is contained in:
Benjamin A. Shelton 2026-10-08 21:21:34 -06:00
commit a4cdfdad06
Signed by: zancarius
GPG key ID: 8BD42DBD6C337E01

View file

@ -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 (