[
  {
    "type": "create_table",
    "description": "Create analytics_category_momentum table for MACD momentum signals",
    "database": "kiosk_sales",
    "check_query": "SHOW TABLES LIKE 'analytics_category_momentum'",
    "sql": "CREATE TABLE `analytics_category_momentum` (`id` int(10) unsigned NOT NULL AUTO_INCREMENT, `storeId` int(10) unsigned NOT NULL COMMENT 'FK to stores', `category` varchar(100) NOT NULL COMMENT 'Category name', `date` date NOT NULL COMMENT 'Calculation date', `itemsSold` int(10) unsigned NOT NULL DEFAULT 0 COMMENT 'Daily item count', `ema12` decimal(12,4) DEFAULT NULL COMMENT '12-day EMA', `ema26` decimal(12,4) DEFAULT NULL COMMENT '26-day EMA', `macdLine` decimal(12,4) DEFAULT NULL COMMENT 'ema12 - ema26', `signalLine` decimal(12,4) DEFAULT NULL COMMENT '9-day EMA of MACD', `histogram` decimal(12,4) DEFAULT NULL COMMENT 'macdLine - signalLine', `momentumSignal` enum('strong_bullish','bullish','neutral','bearish','strong_bearish') DEFAULT 'neutral' COMMENT 'Signal classification', `crossoverEvent` enum('bullish_crossover','bearish_crossover') DEFAULT NULL COMMENT 'Crossover event type', `computedAt` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), PRIMARY KEY (`id`), UNIQUE KEY `unique_store_category_date` (`storeId`, `category`, `date`), KEY `idx_store_date` (`storeId`, `date`), KEY `idx_date_signal` (`date`, `momentumSignal`), KEY `idx_crossover` (`crossoverEvent`, `date`)) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='MACD momentum calculations by category for analytics'"
  }
]
