-- Phase 1: outbox leasing for multi-worker safe dispatch ALTER TABLE "notification_outbox" ADD COLUMN IF NOT EXISTS "locked_at" TIMESTAMP(3); ALTER TABLE "notification_outbox" ADD COLUMN IF NOT EXISTS "locked_by" TEXT; ALTER TABLE "notification_outbox" ADD COLUMN IF NOT EXISTS "attempts" INTEGER NOT NULL DEFAULT 0; ALTER TABLE "notification_outbox" ADD COLUMN IF NOT EXISTS "available_at" TIMESTAMP(3); CREATE INDEX IF NOT EXISTS "notification_outbox_status_available_at_idx" ON "notification_outbox"("status", "available_at");