CREATE TABLE `maintenance_keys` (
	`id` text PRIMARY KEY NOT NULL,
	`token_hash` text NOT NULL,
	`label` text,
	`created_by` text NOT NULL,
	`expires_at` integer NOT NULL,
	`revoked_at` integer,
	`created_at` integer NOT NULL,
	FOREIGN KEY (`created_by`) REFERENCES `users`(`id`) ON UPDATE no action ON DELETE no action
);
--> statement-breakpoint
CREATE UNIQUE INDEX `maintenance_keys_token_hash_unique` ON `maintenance_keys` (`token_hash`);--> statement-breakpoint
CREATE INDEX `maintenance_keys_created_idx` ON `maintenance_keys` (`created_by`);