-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdefault.sql
More file actions
15 lines (14 loc) · 893 Bytes
/
default.sql
File metadata and controls
15 lines (14 loc) · 893 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
-- Rate limiter storage table
-- This table stores the state of rate limiters for persistent storage across requests
CREATE TABLE IF NOT EXISTS `rate_limit_storage` (
`key` VARCHAR(255) NOT NULL COMMENT 'Unique identifier for the rate limit',
`state` JSON NOT NULL COMMENT 'Rate limiter state data as JSON',
`expires_at` TIMESTAMP NULL DEFAULT NULL COMMENT 'When this rate limit entry expires',
`created_at` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT 'When this entry was created',
`updated_at` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT 'When this entry was last updated',
PRIMARY KEY (`key`),
INDEX `idx_expires_at` (`expires_at`) COMMENT 'Index for TTL-based cleanup queries'
) ENGINE=InnoDB
DEFAULT CHARSET=utf8mb4
COLLATE=utf8mb4_unicode_ci
COMMENT='Storage for PHP rate limiter state persistence';