| 37652 |
amit |
1 |
-- Align user.address of active INTERNAL fofo stores with their mapped warehouse address.
|
|
|
2 |
-- Source of truth: transaction.warehouseaddressmapping -> transaction.warehouseaddressmaster,
|
|
|
3 |
-- split exactly as WarehouseAddressMaster.getCustomAddress() does, state via inventory.statemaster.
|
|
|
4 |
-- In-place update: transaction.addId already points at these rows, and user.address feeds no
|
|
|
5 |
-- issued document (invoices read transaction.`order`.customer_address*), so history is unaffected.
|
|
|
6 |
|
|
|
7 |
CREATE TABLE IF NOT EXISTS user._bak_address_internal_whsync_20260916 AS
|
|
|
8 |
SELECT a.* FROM user.address a
|
|
|
9 |
JOIN user.user u ON u.default_address_id = a.id
|
|
|
10 |
JOIN fofo.fofo_store fs ON fs.id = u.id
|
|
|
11 |
WHERE fs.fofo_type='INTERNAL' AND fs.active=1;
|
|
|
12 |
|
|
|
13 |
-- DLSD693 / fofo 175139480
|
|
|
14 |
UPDATE user.address SET line_1='Basement H.No- K819', line_2='Block K-2, Mahipalpur Extn', city='New Delhi', state='Delhi', pin='110037', update_timestamp=NOW() WHERE id=655253;
|
|
|
15 |
-- DLSW097 / fofo 175138806
|
|
|
16 |
UPDATE user.address SET line_1='Basement H.No- K819', line_2='Block K-2, Mahipalpur Extn', city='New Delhi', state='Delhi', pin='110037', update_timestamp=NOW() WHERE id=654183;
|
|
|
17 |
-- DLSW1068 / fofo 175139884
|
|
|
18 |
UPDATE user.address SET line_1='Basement H.No- K819', line_2='Block K-2, Mahipalpur Extn', city='New Delhi', state='Delhi', pin='110037', update_timestamp=NOW() WHERE id=655835;
|
|
|
19 |
-- DLSW869 / fofo 175139678
|
|
|
20 |
UPDATE user.address SET line_1='Basement H.No- K819', line_2='Block K-2, Mahipalpur Extn', city='New Delhi', state='Delhi', pin='110037', update_timestamp=NOW() WHERE id=655515;
|
|
|
21 |
-- MPIN1613 / fofo 175140468
|
|
|
22 |
UPDATE user.address SET line_1='739, Ground Floor, Sector B', line_2='Scheme No. 136, Main Road, Near Brilliant Aura, Vijay Nagar', city='Indore', state='Madhya Pradesh', pin='452010', update_timestamp=NOW() WHERE id=656736;
|
|
|
23 |
-- PBLDH293 (address 654536) already aligned - no change
|
|
|
24 |
-- RJJPR294 / fofo 175139010
|
|
|
25 |
UPDATE user.address SET line_1='53', line_2='Indraprastha Colony, Vaishali Nagar', city='Jaipur', state='Rajasthan', pin='302021', update_timestamp=NOW() WHERE id=655453;
|
|
|
26 |
-- UKDH498 / fofo 171697468
|
|
|
27 |
UPDATE user.address SET line_1='Ground floor of Ganga tower', line_2='6 cross road', city='Dehradun', state='Uttarakhand', pin='248001', update_timestamp=NOW() WHERE id=656555;
|
|
|
28 |
-- UPGBN1516 / fofo 175140371
|
|
|
29 |
UPDATE user.address SET line_1='FIRST FLOOR, D-97', line_2='SECTOR-63, Noida', city='Gautambuddha Nagar', state='Uttar Pradesh', pin='201301', update_timestamp=NOW() WHERE id=656636;
|
|
|
30 |
-- UPGBN1517 / fofo 175140372
|
|
|
31 |
UPDATE user.address SET line_1='FIRST FLOOR, D-97', line_2='SECTOR-63, Noida', city='Gautambuddha Nagar', state='Uttar Pradesh', pin='201301', update_timestamp=NOW() WHERE id=656637;
|
|
|
32 |
-- UPLKO099 / fofo 175138808
|
|
|
33 |
UPDATE user.address SET line_1='F 209 Transport Nagar', line_2='Near Parking No 5', city='Lucknow', state='Uttar Pradesh', pin='226012', update_timestamp=NOW() WHERE id=654185;
|
|
|
34 |
-- UPNO199 / fofo 175138912
|
|
|
35 |
UPDATE user.address SET line_1='FIRST FLOOR, D-97', line_2='SECTOR-63, Noida', city='Gautambuddha Nagar', state='Uttar Pradesh', pin='201301', update_timestamp=NOW() WHERE id=654407;
|
|
|
36 |
-- UPTest / fofo 175120474
|
|
|
37 |
UPDATE user.address SET line_1='FIRST FLOOR, D-97', line_2='SECTOR-63, Noida', city='Gautambuddha Nagar', state='Uttar Pradesh', pin='201301', update_timestamp=NOW() WHERE id=647440;
|
|
|
38 |
|
|
|
39 |
-- 12 rows updated
|