Files
mtusi2026lab5/migrations/005_upload_handoff.sql
T

9 lines
423 B
SQL

-- A paused API must not acknowledge an object that GC has already retired.
CREATE TABLE upload_reservations (
id uuid PRIMARY KEY,
object_key text NOT NULL UNIQUE,
state text NOT NULL DEFAULT 'uploading' CHECK (state IN ('uploading','accepted','abandoned')),
expires_at timestamptz NOT NULL DEFAULT clock_timestamp()+interval '120 seconds',
created_at timestamptz NOT NULL DEFAULT clock_timestamp()
);