Blame | Last modification | View Log | RSS feed
-- Each HR warehouse serves its own stock (APPLIED on hadb1 2026-10-04).-- tbl_cis assigns stock to a warehouse through warehouseBrandMapping (stock in warehouseFrom counts under warehouseTo), and-- no row named an HR warehouse, so the stock moved Delhi -> HR on 2026-10-02 showed nowhere on the dashboard. A self row per-- brand and class makes 13368/13370/13372 count their own stock. Only stores mapped to an HR warehouse route through these-- rows - today just the internal movement stores - so partner order routing is unchanged until the stores are remapped.-- Pairs are every (brand, isAccessory) already in the table: 33 device + 53 accessory brands, 258 rows.-- Backup: inventory._bak_warehouseBrandMapping_20261004. INSERT IGNORE, so a re-run is a no-op.START TRANSACTION;INSERT IGNORE INTO inventory.warehouseBrandMapping (brand, warehouseFrom, warehouseTo, isAccessory)SELECT b.brand, h.wh, h.wh, b.isAccessoryFROM (SELECT DISTINCT brand, isAccessory FROM inventory.warehouseBrandMapping) bCROSS JOIN (SELECT 13368 wh UNION ALL SELECT 13370 UNION ALL SELECT 13372) h;COMMIT;