Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
-- Migration 008: Clean up invalid data before applying stricter constraints in migration 009
-- Migration 007a: Clean up invalid data before applying stricter constraints in migration 008
-- This migration removes or fixes data that would violate constraints introduced in the next migration

BEGIN;
Expand Down Expand Up @@ -27,11 +27,11 @@ BEGIN

-- Skip migration if we don't have the known bad data (indicates test environment)
IF NOT has_known_bad_server THEN
RAISE NOTICE 'Migration 008: Skipping cleanup - no known problematic data found (likely test/dev environment)';
RAISE NOTICE 'Migration 007a: Skipping cleanup - no known problematic data found (likely test/dev environment)';
RETURN; -- Exit early, don't run any cleanup
END IF;

RAISE NOTICE 'Migration 008: Found known problematic data, proceeding with cleanup';
RAISE NOTICE 'Migration 007a: Found known problematic data, proceeding with cleanup';

-- Count servers with invalid name format
SELECT COUNT(*) INTO invalid_name_count
Expand Down Expand Up @@ -67,7 +67,7 @@ BEGIN
OR value->>'version' = '';

-- Log the cleanup operations with safety check
RAISE NOTICE 'Migration 008 Data Cleanup Plan:';
RAISE NOTICE 'Migration 007a Data Cleanup Plan:';
RAISE NOTICE ' Total servers in database: %', total_servers;

IF total_servers > 0 THEN
Expand Down
Loading