diff --git a/appview/database/migrations/0006_phase2_catalog_subjects.sql b/appview/database/migrations/0006_phase2_catalog_subjects.sql index 2424635..bab2e7d 100644 --- a/appview/database/migrations/0006_phase2_catalog_subjects.sql +++ b/appview/database/migrations/0006_phase2_catalog_subjects.sql @@ -2,8 +2,22 @@ -- introduce the episode/podcast catalogs. Every subject-bearing collection -- (comment, recommendation, bookmark, episode_state, subscription) now -- references a catalog record via {subject_uri, subject_cid}. + +-- ----- Pre-Phase-2 wipe ------------------------------------------------- +-- Legacy rows in the social tables reference Podcast Index integer IDs that +-- the Phase 2 schema no longer carries on the record. There is no automatic +-- way to project those rows onto catalog strongRefs — the catalog itself is +-- empty at this point, and even a hydrated catalog wouldn't recover rows +-- whose PI IDs Podcast Index has since reissued. -- --- Nothing is in production, so we drop legacy columns without a backfill. +-- Per the project's "nothing in production yet, wipe freely" stance, we +-- truncate before altering. Authoritative data lives in users' PDS repos; +-- the firehose + xyz.effem.admin.backfillUser rebuild these tables. +TRUNCATE TABLE "comments"; +TRUNCATE TABLE "recommendations"; +TRUNCATE TABLE "bookmarks"; +TRUNCATE TABLE "episode_states"; +TRUNCATE TABLE "subscriptions"; -- ----- Catalog tables ----------------------------------------------------