mirror of
https://github.com/jcreek/CosmicClash.git
synced 2026-09-10 16:04:04 +00:00
11 lines
534 B
SQL
11 lines
534 B
SQL
-- Optional operator-configured regional spend guard. A missing row means
|
|
-- unlimited, preserving existing deployments until they opt into a quota.
|
|
CREATE TABLE allocation_quotas (
|
|
region TEXT PRIMARY KEY CHECK (region IN ('EU', 'NA')),
|
|
window_started_at TIMESTAMPTZ NOT NULL,
|
|
window_seconds INTEGER NOT NULL CHECK (window_seconds > 0),
|
|
used_allocations INTEGER NOT NULL DEFAULT 0 CHECK (used_allocations >= 0),
|
|
max_allocations INTEGER NOT NULL CHECK (max_allocations > 0),
|
|
updated_at TIMESTAMPTZ NOT NULL
|
|
);
|