2026-10-26 15:27:06 -06:00
|
|
|
-- @up
|
|
|
|
|
|
2026-10-27 09:20:23 -06:00
|
|
|
alter table birthdays add column announce boolean default true not null;
|
|
|
|
|
|
|
|
|
|
-- Anniversaries will be re-added in the future, either as a base table for
|
|
|
|
|
-- wedding anniversaries + birthdays or as a single purpose table. If the
|
|
|
|
|
-- former, anniversary types will be implemented as views, and the INSTEAD OF
|
|
|
|
|
-- trigger will be used for inserts and updates:
|
|
|
|
|
-- www.sqlite.org/lang_createtrigger.html#instead_of_trigger
|
2026-10-30 14:29:43 -06:00
|
|
|
drop table anniversaries;
|
|
|
|
|
|
|
|
|
|
drop table announcements;
|
|
|
|
|
create table announcements (
|
|
|
|
|
id integer primary key autoincrement,
|
|
|
|
|
chatid integer not null,
|
|
|
|
|
scheduled_for datetime not null,
|
|
|
|
|
|
|
|
|
|
-- If enabled, reminders will be generated a week before and a day before the announcement itself.
|
|
|
|
|
reminders boolean default true not null,
|
|
|
|
|
title text default '' not null,
|
|
|
|
|
content text default '' not null,
|
|
|
|
|
|
|
|
|
|
foreign key (chatid) references chats(id)
|
|
|
|
|
);
|
|
|
|
|
create index announcements_chatid_idx on announcements (chatid);
|
|
|
|
|
create index announcements_scheduled_for_idx on announcements (scheduled_for);
|