-- AlterTable
ALTER TABLE "bets" ADD COLUMN "is_cashbacked" BOOLEAN NOT NULL DEFAULT false;

-- Backfill: mark bets already paid out via confirmed cashback batches
UPDATE "bets" b
SET "is_cashbacked" = true
FROM "cashback_bets" cb
INNER JOIN "cashback_batches" batch ON batch.id = cb.batch_id
WHERE cb.bet_id = b.id AND batch.status = 'CONFIRMED';
