[
  {
    "type": "create_table",
    "description": "Create aiScheduleSessionLogs table for full AI session logging (Spec 026 PRD Feature 13)",
    "database": "{{store}}",
    "check_query": "SHOW TABLES LIKE 'aiScheduleSessionLogs'",
    "sql": "CREATE TABLE `aiScheduleSessionLogs` (\n  `logId` int(10) unsigned NOT NULL AUTO_INCREMENT,\n  `suggestionId` int(10) unsigned NOT NULL COMMENT 'FK to aiScheduleSuggestions',\n  `promptSent` longtext NOT NULL COMMENT 'Full system + user messages sent to AI',\n  `responseReceived` longtext NOT NULL COMMENT 'Raw AI response',\n  `appliedAssignments` text DEFAULT NULL COMMENT 'JSON array of shift IDs that were accepted',\n  `rejectedAssignments` text DEFAULT NULL COMMENT 'JSON array of shift IDs that were rejected',\n  `manualChangesAfter` text DEFAULT NULL COMMENT 'JSON array of manual changes made after AI apply',\n  `createdAt` datetime NOT NULL DEFAULT current_timestamp(),\n  PRIMARY KEY (`logId`),\n  KEY `idx_suggestion` (`suggestionId`),\n  KEY `idx_created` (`createdAt`)\n) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='AI schedule session logs - 90 day retention (Spec 026)'"
  }
]
