Update: 2026-07-06 19:17:19

This commit is contained in:
Hamza-Ayed
2026-07-06 19:17:20 +03:00
parent d6ab09c19b
commit 3c9a3dbef8
4 changed files with 112 additions and 3 deletions
@@ -0,0 +1,16 @@
-- Migration: Create competitor_surge_zones table for heatmap integration
-- Purpose: Bridge the geographic surge anomalies from Node.js pricing engine to PHP heatmap
CREATE TABLE IF NOT EXISTS `competitor_surge_zones` (
`id` INT AUTO_INCREMENT PRIMARY KEY,
`competitor_name` VARCHAR(100) NOT NULL,
`country_code` VARCHAR(5) NOT NULL,
`zone_key` VARCHAR(50) NOT NULL,
`latitude` DECIMAL(10,6) NOT NULL,
`longitude` DECIMAL(10,6) NOT NULL,
`avg_ppk` DECIMAL(10,3) NOT NULL,
`sample_count` INT NOT NULL,
`surge_multiplier` DECIMAL(5,3) NOT NULL DEFAULT 1.000,
`detected_at` TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
UNIQUE KEY `unique_zone` (`competitor_name`, `country_code`, `zone_key`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;