Skip to content

Commit 21925b7

Browse files
committed
Document why follow-up chat_threads and first_name migrations stay in the chain
Made-with: Cursor
1 parent ca4b81e commit 21925b7

2 files changed

Lines changed: 8 additions & 2 deletions

File tree

supabase/migrations/20260421120000_assign_trimmed_first_name_in_profile_trigger.sql

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
1-
-- Environments that already applied 20260420120000 before we assigned back to NEW.first_name
2-
-- get the same trigger body; new installs get it from the original migration, this is idempotent.
1+
-- Hygiene: 20260420120000 now includes `NEW.first_name := v`, so a fresh `db reset` already
2+
-- creates the right function. This migration replays the same body for databases that ran an
3+
-- earlier revision of 20260420120000 (preview/prod). Re-applying on a new install is a no-op
4+
-- (CREATE OR REPLACE with identical SQL). Safe to keep.
35

46
CREATE OR REPLACE FUNCTION public.enforce_profile_first_name_rules() RETURNS trigger
57
LANGUAGE plpgsql

supabase/migrations/20260421121500_chat_threads_insert_initiator_only.sql

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22
-- Previously, owner_id inserts satisfied (auth.uid() <> initiator_id OR rate_limit) without
33
-- evaluating the thread-initiation limit. Initiator-only insert applies that limit to everyone
44
-- who can create a thread.
5+
--
6+
-- Hygiene: 20260420120000 was updated in Git to the same policy, so a full local `db reset` runs
7+
-- this twice in spirit (idempotent). This file still matters for any database that had already
8+
-- applied an older version of 20260420120000 before that edit (e.g. preview/prod). Safe to keep.
59

610
DROP POLICY IF EXISTS "Users can create threads they're involved in" ON public.chat_threads;
711

0 commit comments

Comments
 (0)