[
  {
    "type": "create_table",
    "description": "Create schedulePublished table to track weekly schedule publications",
    "database": "{{store}}",
    "check_query": "SHOW TABLES LIKE 'schedulePublished'",
    "sql": "CREATE TABLE `schedulePublished` (\n  `publishId` int(10) unsigned NOT NULL AUTO_INCREMENT,\n  `weekStart` date NOT NULL COMMENT 'Monday of the published week',\n  `publishedAt` timestamp NOT NULL DEFAULT current_timestamp() COMMENT 'When schedule was published',\n  `publishedByUserId` int(10) unsigned NOT NULL COMMENT 'Manager who published',\n  `employeesNotified` int(10) unsigned NOT NULL DEFAULT 0 COMMENT 'Number of employees notified',\n  `shiftsPublished` int(10) unsigned NOT NULL DEFAULT 0 COMMENT 'Number of shifts in this publish',\n  `notificationsSent` json NULL COMMENT 'Breakdown: {push: X, sms: Y, email: Z}',\n  PRIMARY KEY (`publishId`),\n  UNIQUE KEY `uk_weekStart` (`weekStart`),\n  KEY `idx_publishedAt` (`publishedAt`)\n) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='Track weekly schedule publications and notification stats'"
  }
]
