ALTER TABLE IF EXISTS document_item
  ADD COLUMN IF NOT EXISTS deleted_at TIMESTAMPTZ;

CREATE INDEX IF NOT EXISTS idx_document_item_deleted_at
  ON document_item (deleted_at);
