-- Adds opt-in flag for automatic director salary adjustment (daemon-controlled)
-- Default is OFF for all existing and future directors.

ALTER TABLE falukant_data.director
  ADD COLUMN IF NOT EXISTS auto_adjust_income boolean;

UPDATE falukant_data.director
SET auto_adjust_income = false
WHERE auto_adjust_income IS NULL;

ALTER TABLE falukant_data.director
  ALTER COLUMN auto_adjust_income SET DEFAULT false;

ALTER TABLE falukant_data.director
  ALTER COLUMN auto_adjust_income SET NOT NULL;
