-- AlterTable: the d20 a combatant rolled for initiative; "initiative" is now roll + bonus ALTER TABLE "encounter_participants" ADD COLUMN "initiativeRoll" INTEGER; -- Initiatives typed in before this were totals. Keep them as they are, and -- treat the nearest possible die face as the roll so those combatants still -- count as having rolled. UPDATE "encounter_participants" SET "initiativeRoll" = LEAST(GREATEST("initiative", 1), 20) WHERE "initiative" <> 0;