CREATE TABLE `rate_limits` (
	`action` text NOT NULL,
	`client_key` text NOT NULL,
	`window_start` integer NOT NULL,
	`count` integer DEFAULT 0 NOT NULL,
	`updated_at` text DEFAULT CURRENT_TIMESTAMP NOT NULL,
	CONSTRAINT "rate_limits_count_positive" CHECK("rate_limits"."count" > 0)
);
--> statement-breakpoint
CREATE UNIQUE INDEX `rate_limits_window_idx` ON `rate_limits` (`action`,`client_key`,`window_start`);--> statement-breakpoint
CREATE INDEX `rate_limits_updated_idx` ON `rate_limits` (`updated_at`);