diff --git a/migrations/sqlite/0003_table_updates.sql b/migrations/sqlite/0003_table_updates.sql index 1124f39..33166d7 100644 --- a/migrations/sqlite/0003_table_updates.sql +++ b/migrations/sqlite/0003_table_updates.sql @@ -7,4 +7,20 @@ alter table birthdays add column announce boolean default true not null; -- 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 -drop table anniversaries; \ No newline at end of file +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); \ No newline at end of file