181_group_duplicate_operation_id.sql 422 B

12345678
  1. -- Persist an internal operation identity for safely recovering an already
  2. -- committed group duplicate when the idempotency response write is ambiguous.
  3. ALTER TABLE groups
  4. ADD COLUMN IF NOT EXISTS duplicate_operation_id VARCHAR(64);
  5. CREATE UNIQUE INDEX IF NOT EXISTS idx_groups_duplicate_operation_id_active
  6. ON groups (duplicate_operation_id)
  7. WHERE duplicate_operation_id IS NOT NULL AND deleted_at IS NULL;