Create and run a Supabase database migration. Use when adding/modifying tables, RLS policies, or functions.
Create a new Supabase migration:
pnpm supabase migration new $ARGUMENTS to create the migration fileid uuid primary key default gen_random_uuid()created_at timestamptz default now() and updated_at timestamptz default now()references for foreign keys with on delete cascade where appropriatepnpm db:migrate to applypnpm db:types to regenerate TypeScript typesauth.uid() = user_idauth.uid() in (select user_id from agency_members where agency_id = table.agency_id)true for select, owner-only for insert/update/delete$ARGUMENTS should be a descriptive migration name like create-bookings-table or add-commission-to-deals.