mirror of
https://github.com/block/buzz.git
synced 2026-11-05 08:51:10 +00:00
12 lines
699 B
SQL
12 lines
699 B
SQL
-- ── Storage accounting snapshot ─────────────────────────────────────────────
|
|
-- Deployment-global singleton produced by the isolated S3 accounting worker.
|
|
|
|
CREATE TABLE storage_accounting_snapshots (
|
|
singleton BOOLEAN PRIMARY KEY DEFAULT TRUE CHECK (singleton),
|
|
snapshot JSONB NOT NULL CHECK (jsonb_typeof(snapshot) = 'object'),
|
|
completed_at TIMESTAMPTZ NOT NULL DEFAULT transaction_timestamp(),
|
|
duration_ms BIGINT NOT NULL CHECK (duration_ms >= 0),
|
|
max_objects BIGINT NOT NULL CHECK (max_objects > 0),
|
|
code_sha TEXT NOT NULL CHECK (octet_length(code_sha) BETWEEN 1 AND 128)
|
|
);
|