CREATE TABLE `password_resets` ( `id` text PRIMARY KEY NOT NULL, `user_id` integer NOT NULL, `expires_at` integer NOT NULL, FOREIGN KEY (`user_id`) REFERENCES `users`(`id`) ON UPDATE no action ON DELETE cascade ); --> statement-breakpoint CREATE TABLE `push_messages` ( `id` integer PRIMARY KEY AUTOINCREMENT NOT NULL, `topic` text NOT NULL, `title` text NOT NULL, `body` text DEFAULT '' NOT NULL, `url` text DEFAULT '/' NOT NULL, `recipients` integer DEFAULT 0 NOT NULL, `failures` integer DEFAULT 0 NOT NULL, `sent_by` integer, `automatic` integer DEFAULT false NOT NULL, `dedupe_key` text, `created_at` integer DEFAULT (unixepoch()) NOT NULL, FOREIGN KEY (`sent_by`) REFERENCES `users`(`id`) ON UPDATE no action ON DELETE set null ); --> statement-breakpoint CREATE UNIQUE INDEX `push_messages_dedupe_key_unique` ON `push_messages` (`dedupe_key`);--> statement-breakpoint CREATE TABLE `push_subscriptions` ( `id` integer PRIMARY KEY AUTOINCREMENT NOT NULL, `endpoint` text NOT NULL, `p256dh` text NOT NULL, `auth` text NOT NULL, `topics` text DEFAULT '[]' NOT NULL, `created_at` integer DEFAULT (unixepoch()) NOT NULL, `updated_at` integer DEFAULT (unixepoch()) NOT NULL ); --> statement-breakpoint CREATE UNIQUE INDEX `push_subscriptions_endpoint_unique` ON `push_subscriptions` (`endpoint`);--> statement-breakpoint CREATE TABLE `rate_limits` ( `id` integer PRIMARY KEY AUTOINCREMENT NOT NULL, `key` text NOT NULL, `at` integer NOT NULL ); --> statement-breakpoint CREATE INDEX `rate_limits_key_idx` ON `rate_limits` (`key`,`at`);--> statement-breakpoint ALTER TABLE `messages` ADD `kind` text DEFAULT 'contact' NOT NULL;--> statement-breakpoint ALTER TABLE `messages` ADD `page_url` text DEFAULT '' NOT NULL;--> statement-breakpoint ALTER TABLE `posts` ADD `notify` integer DEFAULT false NOT NULL;--> statement-breakpoint ALTER TABLE `posts` ADD `notified_at` integer;--> statement-breakpoint ALTER TABLE `users` ADD `totp_secret` text;--> statement-breakpoint ALTER TABLE `users` ADD `totp_enabled` integer DEFAULT false NOT NULL;--> statement-breakpoint ALTER TABLE `users` ADD `recovery_codes` text DEFAULT '[]' NOT NULL;