Update: 2026-07-06 17:51:16
This commit is contained in:
@@ -2146,3 +2146,33 @@ INSERT IGNORE INTO `api_quotas` (`service_name`, `daily_usage`, `quota_limit`, `
|
||||
('gemini', 0, 100, CURDATE()),
|
||||
('elevenlabs', 0, 5, CURDATE()),
|
||||
('creatomate', 0, 2, CURDATE());
|
||||
|
||||
-- 3. Competitor Analysis & Surge Pricing Engine Tables
|
||||
CREATE TABLE IF NOT EXISTS `competitor_secret_formulas` (
|
||||
`id` INT AUTO_INCREMENT PRIMARY KEY,
|
||||
`competitor_name` VARCHAR(100) NOT NULL,
|
||||
`country_code` VARCHAR(10) NOT NULL,
|
||||
`tier` VARCHAR(20) DEFAULT 'standard',
|
||||
`base_fare` DECIMAL(8,3) NOT NULL,
|
||||
`price_per_km` DECIMAL(8,3) NOT NULL,
|
||||
`price_per_min` DECIMAL(8,3) NOT NULL,
|
||||
`min_fare` DECIMAL(8,3) DEFAULT 0,
|
||||
`rmse` DECIMAL(10,4) DEFAULT 0,
|
||||
`r_squared` DECIMAL(10,4) DEFAULT 0,
|
||||
`surge_multiplier` DECIMAL(5,3) DEFAULT 1.0,
|
||||
`sample_size` INT DEFAULT 0,
|
||||
`last_updated` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||
UNIQUE KEY `idx_comp_country_tier` (`competitor_name`, `country_code`, `tier`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `competitor_surge_insights` (
|
||||
`id` INT AUTO_INCREMENT PRIMARY KEY,
|
||||
`competitor_name` VARCHAR(100) NOT NULL,
|
||||
`country_code` VARCHAR(5) NOT NULL,
|
||||
`surge_multiplier` DECIMAL(5,3) NOT NULL,
|
||||
`peak_start_hour` INT NOT NULL,
|
||||
`peak_end_hour` INT NOT NULL,
|
||||
`sample_count` INT NOT NULL,
|
||||
`detected_at` TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
|
||||
UNIQUE KEY `unique_surge` (`competitor_name`, `country_code`, `peak_start_hour`, `peak_end_hour`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
|
||||
|
||||
Reference in New Issue
Block a user