-- Backs the rate limiters (failed logins, sign-ups, OIDC/device start) with -- Postgres instead of an in-memory map, now that the server runs more than -- one replica in production (v0.37.0): a counter that only ever sees its own -- pod's traffic quietly let every one of these limits through multiplied by -- the replica count. -- -- window_start is the start of the current fixed window for key, in the same -- "unix seconds" shape every other timestamp in this schema uses. The window -- resets rather than slides, matching the in-memory limiter it replaces: -- once a key's window is older than the limiter's window length, the next -- failure starts a fresh one instead of extending the stale one. CREATE TABLE rate_limit_counters ( key TEXT PRIMARY KEY, window_start BIGINT NOT NULL, count INT NOT NULL );