CREATE TABLE `otp_codes` (
	`id` integer PRIMARY KEY AUTOINCREMENT NOT NULL,
	`email` text NOT NULL,
	`code_hash` text NOT NULL,
	`expires_at` integer NOT NULL,
	`attempts` integer DEFAULT 0 NOT NULL,
	`consumed` integer DEFAULT 0 NOT NULL,
	`created_at` integer NOT NULL,
	`purpose` text DEFAULT 'register' NOT NULL
);
--> statement-breakpoint
CREATE INDEX `otp_email_idx` ON `otp_codes` (`email`,`created_at`);