From 22e0d7db37660d6f44838187ddbd648846acdc4a Mon Sep 17 00:00:00 2001 From: Jared Pereira Date: Thu, 28 May 2026 15:56:06 -0400 Subject: [PATCH] drop bsky_profiles foreign key constraint on comments --- .../20260528000000_drop_comments_profile_fkey.sql | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 supabase/migrations/20260528000000_drop_comments_profile_fkey.sql diff --git a/supabase/migrations/20260528000000_drop_comments_profile_fkey.sql b/supabase/migrations/20260528000000_drop_comments_profile_fkey.sql new file mode 100644 index 00000000..64feb58f --- /dev/null +++ b/supabase/migrations/20260528000000_drop_comments_profile_fkey.sql @@ -0,0 +1,8 @@ +-- comments_on_documents.profile stores the commenter's DID, but it no longer +-- needs to reference a bsky_profiles row: commenter profiles are now resolved +-- through the profile cache (getProfiles), and nothing writes to bsky_profiles +-- anymore. Drop the foreign key so comment inserts don't require a pre-existing +-- bsky_profiles row. The profile column itself stays populated (read by +-- getProfileComments via .eq("profile", did)). +alter table "public"."comments_on_documents" + drop constraint if exists "comments_on_documents_profile_fkey"; -- 2.51.2