[
  {
    "type": "raw_sql",
    "description": "Spec 049 Issue-3 fix: Add minOccurrences INT column to storeBreakPolicyRule (per-store DB). Default=1 preserves existing behaviour for all current cloned rules.",
    "database": "{{store}}",
    "check_query": "SELECT 1 FROM information_schema.columns WHERE table_schema=DATABASE() AND table_name='storeBreakPolicyRule' AND column_name='minOccurrences' LIMIT 1",
    "sql": "ALTER TABLE `storeBreakPolicyRule` ADD COLUMN `minOccurrences` INT UNSIGNED NOT NULL DEFAULT 1 COMMENT 'Minimum times this rule must be satisfied per shift (propagated from preset via re-adopt or manual set)' AFTER `isRequired`"
  },
  {
    "type": "raw_sql",
    "description": "Spec 049 Issue-5 fix: Add triggerShiftMinHoursInclusive BOOLEAN column to storeBreakPolicyRule (per-store DB). Default=1 (inclusive) preserves existing behaviour.",
    "database": "{{store}}",
    "check_query": "SELECT 1 FROM information_schema.columns WHERE table_schema=DATABASE() AND table_name='storeBreakPolicyRule' AND column_name='triggerShiftMinHoursInclusive' LIMIT 1",
    "sql": "ALTER TABLE `storeBreakPolicyRule` ADD COLUMN `triggerShiftMinHoursInclusive` TINYINT(1) NOT NULL DEFAULT 1 COMMENT 'true=inclusive (>=), false=exclusive (>) — propagated from preset at adopt time' AFTER `triggerShiftMaxHours`"
  }
]
