| 12345678910111213 |
- -- 创建 API 密钥表
- CREATE TABLE IF NOT EXISTS api_keys (
- id INT AUTO_INCREMENT PRIMARY KEY,
- api_key VARCHAR(255) NOT NULL UNIQUE,
- created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
- expired_at TIMESTAMP NULL,
- is_active BOOLEAN DEFAULT TRUE,
- INDEX idx_api_key (api_key),
- INDEX idx_is_active (is_active)
- ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
- -- 插入一个示例 API 密钥(仅供测试使用)
- INSERT IGNORE INTO api_keys (api_key, is_active) VALUES ('sk-test1234567890', TRUE);
|