[
  {
    "type": "create_table",
    "description": "Create aiScheduleSuggestions table for AI-generated schedule suggestions (Spec 026)",
    "database": "{{store}}",
    "check_query": "SHOW TABLES LIKE 'aiScheduleSuggestions'",
    "sql": "CREATE TABLE `aiScheduleSuggestions` (\n  `suggestionId` int(10) unsigned NOT NULL AUTO_INCREMENT,\n  `jobId` varchar(36) NOT NULL COMMENT 'UUID FK to aiScheduleJobs',\n  `weekStart` date NOT NULL,\n  `weekEnd` date NOT NULL,\n  `generatedAt` datetime NOT NULL DEFAULT current_timestamp(),\n  `generatedByUserId` int(10) unsigned NOT NULL,\n  `optimizationPriorities` text NOT NULL COMMENT 'JSON array of priority strings',\n  `customInstructions` text DEFAULT NULL,\n  `includeOwnerIds` text DEFAULT NULL COMMENT 'JSON array of owner user IDs',\n  `openAiModel` varchar(50) DEFAULT NULL,\n  `openAiPromptTokens` int(10) unsigned DEFAULT NULL,\n  `openAiCompletionTokens` int(10) unsigned DEFAULT NULL,\n  `requestDurationMs` int(10) unsigned DEFAULT NULL,\n  `suggestions` longtext NOT NULL COMMENT 'JSON array of assignment objects per SDD schema',\n  `status` enum('pending','applied','dismissed','expired') NOT NULL DEFAULT 'pending',\n  `appliedAt` datetime DEFAULT NULL,\n  `appliedByUserId` int(10) unsigned DEFAULT NULL,\n  `dismissedAt` datetime DEFAULT NULL,\n  `acceptedCount` int(10) unsigned NOT NULL DEFAULT 0,\n  `rejectedCount` int(10) unsigned NOT NULL DEFAULT 0,\n  PRIMARY KEY (`suggestionId`),\n  KEY `idx_week` (`weekStart`),\n  KEY `idx_status` (`status`),\n  KEY `idx_job` (`jobId`)\n) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='AI schedule suggestions (Spec 026)'"
  }
]
