-- Backfill codes for resource types inserted before code column was added
UPDATE resource_types
SET code = LOWER(name)
WHERE code IS NULL OR code = '';
