Update: 2026-08-02 22:51:18

This commit is contained in:
Hamza-Ayed
2026-08-02 22:51:18 +03:00
parent c9af364cbc
commit 2c962bf80a
39 changed files with 627 additions and 191 deletions
@@ -0,0 +1,19 @@
-- ============================================================
-- scraped_competitor_prices: add distance_km / duration_min
-- ============================================================
-- backend/bot/worker.php computes both values via OSRM
-- (core/osrm_routing.php) and has always listed them in its
-- INSERT, but the columns were never created — so every
-- production bot submission failed with a PDOException.
--
-- Consumers currently derive distance as
-- (price_amount / price_per_km)
-- e.g. Admin/marketing/what_if_simulator.php and
-- Admin/marketing/trigger_campaign.php
-- Those keep working unchanged; the new columns are additive
-- and nullable, so historical rows stay valid.
-- ============================================================
ALTER TABLE `scraped_competitor_prices`
ADD COLUMN `distance_km` DECIMAL(8,3) DEFAULT NULL AFTER `price_per_km`,
ADD COLUMN `duration_min` DECIMAL(8,2) DEFAULT NULL AFTER `distance_km`;