Subversion Repositories SmartDukaan

Rev

Rev 37650 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
37650 amit 1
-- Retire user.counter / user.privatedealuser / user.privatedealuseraddressmapping
2
--
3
-- Partner GST moved to fofo.fofo_store.gst_number in the Feb-2026 migration. Since then
4
-- counter.gstin has had no reader (Counter.getGstin() had no callers) and privatedealuser
5
-- was read only to decide its own insert-vs-update. Code writes removed in dao r37648 /
6
-- web r37649.
7
--
37688 amit 8
-- APPLIED on hadb1 2026-09-17 20:1x, after dao r37648 + web r37649 were deployed (fofo 09-17 11:35,
9
-- web 09-16 19:56). Kept here for the rollback and the later DROP.
37650 amit 10
-- RUN ONLY AFTER dao r37648 + web r37649 ARE DEPLOYED. The currently deployed code still
11
-- inserts into these tables on every partner onboarding/update; renaming them first makes
12
-- that write fail and rolls back the retailer save.
13
--
14
-- Rename rather than DROP: reversible for as long as the renamed tables are kept.
15
-- Verified before writing this script (2026-09-16):
16
--   * no foreign keys reference either table
17
--   * no Reportico report on static0 references them (240 XMLs, 13 projects)
18
--   * counters 1,979 rows / privatedealuser 35,928 rows / address mapping 3,381 rows
19
 
20
-- 1. Confirm nothing has written since the deploy (expect the same max ids as at deploy time)
21
SELECT MAX(id) max_counter_id FROM user.counter;
22
SELECT COUNT(*) pdu_rows FROM user.privatedealuser;
23
 
24
-- 2. Rename out of the way
37688 amit 25
RENAME TABLE user.counter                     TO user.counter_dropped_20260917;
26
RENAME TABLE user.privatedealuser             TO user.privatedealuser_dropped_20260917;
27
RENAME TABLE user.privatedealuseraddressmapping TO user.privatedealuseraddressmapping_dropped_20260917;
37650 amit 28
 
29
-- 3. Verify: onboarding a partner and updating retailer details must still succeed.
30
-- Rollback if needed:
37688 amit 31
--   RENAME TABLE user.counter_dropped_20260917 TO user.counter;
32
--   RENAME TABLE user.privatedealuser_dropped_20260917 TO user.privatedealuser;
33
--   RENAME TABLE user.privatedealuseraddressmapping_dropped_20260917 TO user.privatedealuseraddressmapping;
37650 amit 34
 
35
-- 4. After a safe interval with no issues:
37688 amit 36
--   DROP TABLE user.counter_dropped_20260917;
37
--   DROP TABLE user.privatedealuser_dropped_20260917;
38
--   DROP TABLE user.privatedealuseraddressmapping_dropped_20260917;