ALTER TABLE school_product_config
  ADD COLUMN faculty_management_enabled TINYINT(1) NOT NULL DEFAULT 1 COMMENT 'whether faculty management is enabled' AFTER student_roster_owner,
  ADD COLUMN major_management_enabled TINYINT(1) NOT NULL DEFAULT 1 COMMENT 'whether major management is enabled' AFTER faculty_management_enabled,
  ADD COLUMN admin_class_management_enabled TINYINT(1) NOT NULL DEFAULT 1 COMMENT 'whether administrative class management is enabled' AFTER major_management_enabled;

UPDATE school_product_config
SET faculty_management_enabled = CASE WHEN organization_mode = 'TEACHING_CLASS_ONLY' THEN 0 ELSE 1 END,
    major_management_enabled = CASE WHEN organization_mode = 'TEACHING_CLASS_ONLY' THEN 0 ELSE 1 END,
    admin_class_management_enabled = CASE WHEN organization_mode = 'TEACHING_CLASS_ONLY' THEN 0 ELSE 1 END;
