<?php
declare(strict_types=1);

return [
    'up' => "
CREATE TABLE IF NOT EXISTS api_rate_limits (
    ip VARCHAR(45) NOT NULL,
    route_key VARCHAR(64) NOT NULL,
    hits INT UNSIGNED NOT NULL DEFAULT 1,
    window_start DATETIME NOT NULL,
    PRIMARY KEY (ip, route_key),
    INDEX idx_window (window_start)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci
",
    'down' => "DROP TABLE IF EXISTS api_rate_limits",
];
