| Line 3... |
Line 3... |
| 3 |
-- Partner GST moved to fofo.fofo_store.gst_number in the Feb-2026 migration. Since then
|
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
|
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 /
|
5 |
-- was read only to decide its own insert-vs-update. Code writes removed in dao r37648 /
|
| 6 |
-- web r37649.
|
6 |
-- web r37649.
|
| 7 |
--
|
7 |
--
|
| - |
|
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.
|
| 8 |
-- RUN ONLY AFTER dao r37648 + web r37649 ARE DEPLOYED. The currently deployed code still
|
10 |
-- RUN ONLY AFTER dao r37648 + web r37649 ARE DEPLOYED. The currently deployed code still
|
| 9 |
-- inserts into these tables on every partner onboarding/update; renaming them first makes
|
11 |
-- inserts into these tables on every partner onboarding/update; renaming them first makes
|
| 10 |
-- that write fail and rolls back the retailer save.
|
12 |
-- that write fail and rolls back the retailer save.
|
| 11 |
--
|
13 |
--
|
| 12 |
-- Rename rather than DROP: reversible for as long as the renamed tables are kept.
|
14 |
-- Rename rather than DROP: reversible for as long as the renamed tables are kept.
|
| Line 18... |
Line 20... |
| 18 |
-- 1. Confirm nothing has written since the deploy (expect the same max ids as at deploy time)
|
20 |
-- 1. Confirm nothing has written since the deploy (expect the same max ids as at deploy time)
|
| 19 |
SELECT MAX(id) max_counter_id FROM user.counter;
|
21 |
SELECT MAX(id) max_counter_id FROM user.counter;
|
| 20 |
SELECT COUNT(*) pdu_rows FROM user.privatedealuser;
|
22 |
SELECT COUNT(*) pdu_rows FROM user.privatedealuser;
|
| 21 |
|
23 |
|
| 22 |
-- 2. Rename out of the way
|
24 |
-- 2. Rename out of the way
|
| 23 |
RENAME TABLE user.counter TO user.counter_dropped_20260916;
|
25 |
RENAME TABLE user.counter TO user.counter_dropped_20260917;
|
| 24 |
RENAME TABLE user.privatedealuser TO user.privatedealuser_dropped_20260916;
|
26 |
RENAME TABLE user.privatedealuser TO user.privatedealuser_dropped_20260917;
|
| 25 |
RENAME TABLE user.privatedealuseraddressmapping TO user.privatedealuseraddressmapping_dropped_20260916;
|
27 |
RENAME TABLE user.privatedealuseraddressmapping TO user.privatedealuseraddressmapping_dropped_20260917;
|
| 26 |
|
28 |
|
| 27 |
-- 3. Verify: onboarding a partner and updating retailer details must still succeed.
|
29 |
-- 3. Verify: onboarding a partner and updating retailer details must still succeed.
|
| 28 |
-- Rollback if needed:
|
30 |
-- Rollback if needed:
|
| 29 |
-- RENAME TABLE user.counter_dropped_20260916 TO user.counter;
|
31 |
-- RENAME TABLE user.counter_dropped_20260917 TO user.counter;
|
| 30 |
-- RENAME TABLE user.privatedealuser_dropped_20260916 TO user.privatedealuser;
|
32 |
-- RENAME TABLE user.privatedealuser_dropped_20260917 TO user.privatedealuser;
|
| 31 |
-- RENAME TABLE user.privatedealuseraddressmapping_dropped_20260916 TO user.privatedealuseraddressmapping;
|
33 |
-- RENAME TABLE user.privatedealuseraddressmapping_dropped_20260917 TO user.privatedealuseraddressmapping;
|
| 32 |
|
34 |
|
| 33 |
-- 4. After a safe interval with no issues:
|
35 |
-- 4. After a safe interval with no issues:
|
| 34 |
-- DROP TABLE user.counter_dropped_20260916;
|
36 |
-- DROP TABLE user.counter_dropped_20260917;
|
| 35 |
-- DROP TABLE user.privatedealuser_dropped_20260916;
|
37 |
-- DROP TABLE user.privatedealuser_dropped_20260917;
|
| 36 |
-- DROP TABLE user.privatedealuseraddressmapping_dropped_20260916;
|
38 |
-- DROP TABLE user.privatedealuseraddressmapping_dropped_20260917;
|