-- =============================================================================
-- 13-work-schedule-correction-limit.sql
-- Migration: WorkScheduleCorrectionLimit1781030000000
-- Run AFTER 07-work-schedule-timezone.sql
-- Standard MySQL/MariaDB syntax. Safe to re-run migration INSERT only.
-- If column already exists, skip the ALTER line (error #1060).
-- =============================================================================

ALTER TABLE `working_schedule`
  ADD `monthly_correction_limit` INT NOT NULL DEFAULT 2;

INSERT INTO migrations (timestamp, name)
SELECT 1781030000000, 'WorkScheduleCorrectionLimit1781030000000'
WHERE NOT EXISTS (
  SELECT 1 FROM migrations WHERE name = 'WorkScheduleCorrectionLimit1781030000000'
);

SHOW COLUMNS FROM `working_schedule` LIKE 'monthly_correction_limit';
