-- Add "By salary scale type" (e.g. CONTISS, CONUASS) to allowance parameter rules.
-- Run after migration_staff_roles_and_allowance_parameter_rules.sql
-- mysql -u root university_payroll < sql/migration_allowance_rules_by_scale_type.sql

ALTER TABLE allowance_parameter_rules
ADD COLUMN scale_type VARCHAR(50) NULL AFTER staff_office_role_id
COMMENT 'When apply_to = by_scale_type: staff whose salary level has this scale_type';

ALTER TABLE allowance_parameter_rules
MODIFY COLUMN apply_to ENUM('all','by_union','by_category','by_office_role','by_scale_type') NOT NULL;
