feat(multiplayer): add shared allocation quota

This commit is contained in:
Josh Creek
2026-09-01 18:38:06 +01:00
parent 55706ba9ea
commit 72e8d27633
11 changed files with 211 additions and 4 deletions
@@ -0,0 +1,10 @@
-- 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
);