[
  {
    "type": "create_table",
    "description": "Create daybook_kpi_config table for KPI configuration",
    "database": "{{store}}",
    "check_query": "SHOW TABLES LIKE 'daybook_kpi_config'",
    "sql": "CREATE TABLE `daybook_kpi_config` (`id` int(10) unsigned NOT NULL AUTO_INCREMENT, `kpiKey` varchar(50) NOT NULL COMMENT 'sales, avgTrans, tradePercent, etc.', `displayName` varchar(100) NOT NULL, `isVisible` tinyint(1) unsigned DEFAULT 1, `sortOrder` int(10) unsigned DEFAULT 0, `showGoal` tinyint(1) unsigned DEFAULT 1, `showComps` tinyint(1) unsigned DEFAULT 1, PRIMARY KEY (`id`), UNIQUE KEY `uk_kpiKey` (`kpiKey`)) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci"
  },
  {
    "type": "insert",
    "description": "Insert default KPI configuration values",
    "database": "{{store}}",
    "check_query": "SELECT 1 FROM daybook_kpi_config LIMIT 1",
    "sql": "INSERT INTO `daybook_kpi_config` (`kpiKey`, `displayName`, `sortOrder`, `isVisible`, `showGoal`, `showComps`) VALUES ('sales', 'Sales', 1, 1, 1, 1), ('avgTrans', 'Avg Trans', 2, 1, 0, 1), ('tradePercent', 'Trade %', 3, 1, 0, 0), ('transactions', 'Transactions', 4, 1, 0, 1), ('laborHours', 'Labor Hours', 5, 1, 0, 0), ('laborPercent', 'Labor %', 6, 1, 0, 0), ('salesPerLaborHour', 'Sales/Labor Hr', 7, 1, 0, 0), ('buys', 'Buys', 8, 1, 1, 1), ('totalWages', 'Total Wages', 9, 0, 0, 0)"
  }
]
