CREATE TABLE IF NOT EXISTS operation_requests ( operation_type TEXT NOT NULL CHECK (operation_type <> '' AND char_length(operation_type) <= 100), operation_id TEXT NOT NULL CHECK (operation_id <> '' AND char_length(operation_id) <= 128), request_fingerprint_sha256 CHAR(64) NOT NULL CHECK (request_fingerprint_sha256 ~ '^[0-9a-f]{64}$'), state TEXT NOT NULL DEFAULT 'completed' CHECK (state IN ('completed')), result JSONB NOT NULL, created_at TIMESTAMPTZ NOT NULL, completed_at TIMESTAMPTZ NOT NULL, UNIQUE (operation_type, operation_id) );