You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: always log specific servers being modified in migration 008
- Log all servers being deleted with their name, version, and reason
- Log all servers having status updated with current status
- Provides full transparency for audit purposes
- Still includes safety checks to prevent unexpected data loss
RAISE EXCEPTION 'Safety check failed: Expected to delete exactly 5 servers but would delete %. Check the log above for details. Aborting to prevent data loss.', total_to_delete;
92
87
END IF;
93
88
94
-
IF invalid_status_count !=1 THEN
95
-
-- Log the specific servers that would have status updated
96
-
RAISE NOTICE 'Servers that would have status updated:';
89
+
-- Always log the specific servers that will have status updated for transparency
90
+
IF invalid_status_count >0 THEN
91
+
RAISE NOTICE '';
92
+
RAISE NOTICE 'Servers that will have status updated:';
97
93
FOR r IN
98
94
SELECT value->>'name'as name, value->>'version'as version, value->>'status'as status
-- SAFETY CHECK: Fail if numbers don't match what we found in production
106
+
-- Based on comprehensive analysis of production data (2025-09-30), we expect:
107
+
-- - 5 servers to delete (1 invalid name + 4 empty versions)
108
+
-- - 1 server status to update
109
+
IF total_to_delete !=5 THEN
110
+
RAISE EXCEPTION 'Safety check failed: Expected to delete exactly 5 servers but would delete %. Check the log above for details. Aborting to prevent data loss.', total_to_delete;
111
+
END IF;
112
+
113
+
IF invalid_status_count !=1 THEN
108
114
RAISE EXCEPTION 'Safety check failed: Expected to update exactly 1 server status but would update %. Check the log above for details. Aborting to prevent data corruption.', invalid_status_count;
0 commit comments