-- Biome column for enemy templates (canonical ids from internal/world levelBands). -- For databases that ran 000006a before biome existed; fresh installs get column from 000006a_head. ALTER TABLE public.enemies ADD COLUMN IF NOT EXISTS biome text; UPDATE public.enemies SET biome = substring(type from '[^_]+$') WHERE biome IS NULL OR trim(biome) = ''; ALTER TABLE public.enemies ALTER COLUMN biome SET NOT NULL;