[
  {
    "type": "create_table",
    "description": "Create scheduleAvailabilityExceptions table for date-specific availability overrides",
    "database": "{{store}}",
    "check_query": "SHOW TABLES LIKE 'scheduleAvailabilityExceptions'",
    "sql": "CREATE TABLE `scheduleAvailabilityExceptions` (\n  `exceptionId` int(10) unsigned NOT NULL AUTO_INCREMENT,\n  `employeeId` int(10) unsigned NOT NULL COMMENT 'FK to employees.employeeId',\n  `exceptionDate` date NOT NULL COMMENT 'Specific date for this exception',\n  `isUnavailable` tinyint(1) NOT NULL DEFAULT 1 COMMENT 'TRUE = cannot work, FALSE = can work (override)',\n  `startTime` time NULL COMMENT 'Available from (if not fully unavailable)',\n  `endTime` time NULL COMMENT 'Available until',\n  `reason` varchar(255) NULL COMMENT 'Optional reason for the exception',\n  `createdAt` timestamp NOT NULL DEFAULT current_timestamp(),\n  PRIMARY KEY (`exceptionId`),\n  UNIQUE KEY `uk_employee_date` (`employeeId`, `exceptionDate`),\n  KEY `idx_employeeId` (`employeeId`),\n  KEY `idx_exceptionDate` (`exceptionDate`)\n) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='Date-specific availability overrides for employees'"
  }
]
