This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| -- Delete the 3 orphan campaign_enrollment rows (no FKs pointing at them — safe) | |
| DELETE FROM agent.campaign_enrollment WHERE id = 'af4e2b98-7cb5-41a9-be78-7478b2ab2e11'; | |
| DELETE FROM agent.campaign_enrollment WHERE id = '86fadb3a-04a8-40c7-821a-361a087d2e8b'; | |
| DELETE FROM agent.campaign_enrollment WHERE id = '1be2be0e-8cd2-4391-8ca3-82ec6c387f2d'; | |
| -- Mark the test people as merged duplicates (dashboard filters these out) | |
| -- Not deleting because FK dependencies from phone_lookup and many other tables | |
| UPDATE core.people SET is_merged_duplicate = TRUE WHERE id = '576be874-2588-4b48-82c3-d3eb4035c9db'; | |
| UPDATE core.people SET is_merged_duplicate = TRUE WHERE id = 'a270e6a3-dd67-4ce7-8ab5-3aa754a24ad4'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| DELETE FROM agent.campaign_enrollment WHERE id = 'af4e2b98-7cb5-41a9-be78-7478b2ab2e11'; | |
| DELETE FROM agent.campaign_enrollment WHERE id = '86fadb3a-04a8-40c7-821a-361a087d2e8b'; | |
| DELETE FROM agent.campaign_enrollment WHERE id = '1be2be0e-8cd2-4391-8ca3-82ec6c387f2d'; | |
| DELETE FROM core.people WHERE id = '576be874-2588-4b48-82c3-d3eb4035c9db'; | |
| DELETE FROM core.people WHERE id = 'a270e6a3-dd67-4ce7-8ab5-3aa754a24ad4'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| -- Part 1: Backfill summit_registrants | |
| UPDATE summit_registrants | |
| SET funnel_source = 'ecosystem' | |
| WHERE LOWER(utm_source) = 'visioneer' | |
| AND LOWER(utm_medium) = 'referral' | |
| AND COALESCE(funnel_source, '') <> 'ecosystem'; | |
| -- Part 2: Backfill campaign_enrollment | |
| UPDATE agent.campaign_enrollment ce | |
| SET source = 'ecosystem' |