-- AlterTable: the path a character takes within their class, as a key from -- game/data/subclasses.js. ALTER TABLE "characters" ADD COLUMN "subclass" TEXT; -- Until now every class followed one path, written onto the sheet as the -- character levelled. Finished characters already at the level their class -- chooses at are given that path as their subclass. UPDATE "characters" SET "subclass" = CASE "characterClass" WHEN 'BARBARIAN' THEN 'BERSERKER' WHEN 'BARD' THEN 'LORE' WHEN 'CLERIC' THEN 'LIFE' WHEN 'DRUID' THEN 'LAND' WHEN 'FIGHTER' THEN 'CHAMPION' WHEN 'MONK' THEN 'OPEN_HAND' WHEN 'PALADIN' THEN 'DEVOTION' WHEN 'RANGER' THEN 'HUNTER' WHEN 'ROGUE' THEN 'THIEF' WHEN 'SORCERER' THEN 'DRACONIC' WHEN 'WARLOCK' THEN 'FIEND' WHEN 'WIZARD' THEN 'EVOCATION' END WHERE "buildStage" = 'COMPLETE' AND "characterClass" IS NOT NULL AND "level" >= CASE WHEN "characterClass" IN ('CLERIC', 'DRUID', 'WIZARD') THEN 2 ELSE 3 END;