feat: add opt-in daily Discord reminders with quiet hours

This commit is contained in:
syntaxbullet
2026-09-04 18:45:42 +02:00
parent 16d92f171c
commit 1208e93953
22 changed files with 2367 additions and 9 deletions

View File

@@ -0,0 +1,20 @@
CREATE TABLE `reminder_deliveries` (
`id` text PRIMARY KEY NOT NULL,
`user_id` text NOT NULL,
`date` text NOT NULL,
`status` text NOT NULL,
`retry_at` integer,
`updated_at` integer NOT NULL,
FOREIGN KEY (`user_id`) REFERENCES `users`(`id`) ON UPDATE no action ON DELETE cascade
);
--> statement-breakpoint
CREATE UNIQUE INDEX `reminder_deliveries_user_date_idx` ON `reminder_deliveries` (`user_id`,`date`);--> statement-breakpoint
CREATE TABLE `reminder_settings` (
`user_id` text PRIMARY KEY NOT NULL,
`enabled` integer DEFAULT false NOT NULL,
`time` text DEFAULT '20:00' NOT NULL,
`quiet_start` text DEFAULT '22:00' NOT NULL,
`quiet_end` text DEFAULT '08:00' NOT NULL,
`updated_at` integer NOT NULL,
FOREIGN KEY (`user_id`) REFERENCES `users`(`id`) ON UPDATE no action ON DELETE cascade
);