[
  {
    "type": "create_table",
    "description": "Create goalForecast table for daily goal cache (Spec 046)",
    "database": "{{store}}",
    "check_query": "SHOW TABLES LIKE 'goalForecast'",
    "sql": "CREATE TABLE `goalForecast` (\n  `id` INT UNSIGNED NOT NULL AUTO_INCREMENT,\n  `forecastDate` DATE NOT NULL,\n  `salesGoal` DECIMAL(12,2) NOT NULL DEFAULT 0.00,\n  `buysGoal` DECIMAL(12,2) NOT NULL DEFAULT 0.00,\n  `confidence` ENUM('high','medium','low') NOT NULL DEFAULT 'low',\n  `goalMethod` TINYINT UNSIGNED NOT NULL DEFAULT 0,\n  `hourlySalesDistribution` JSON DEFAULT NULL COMMENT '24-element float array',\n  `source` ENUM('server','sync_fallback') NOT NULL DEFAULT 'server',\n  `computedAt` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,\n  PRIMARY KEY (`id`),\n  UNIQUE KEY `uk_forecastDate` (`forecastDate`),\n  KEY `idx_dateRange` (`forecastDate`, `source`)\n) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='Pre-computed daily goal forecast cache (Spec 046)'"
  }
]
