Files
minabot/drizzle/0007_reminders.sql

21 lines
806 B
SQL

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
);