Skip to content

fix(db): index accountability_circle_members in 20260914 migration (#387) - #407

Merged
TheVicky1 merged 1 commit into
TheVicky1:mainfrom
mutabalShawandar:fix/387-circle-members-index-table
Oct 6, 2026
Merged

TheVicky1 merged 1 commit into
TheVicky1:mainfrom
mutabalShawandar:fix/387-circle-members-index-table

Conversation

@mutabalShawandar

Copy link
Copy Markdown
Contributor

1. Related Issue

Fixes #387

2. Summary of Changes

20260914000000_production_resilience_and_telemetry.sql created two indexes on public.circle_members, a table that no migration creates. The table from 20260913000000_accountability_circles_and_pledges.sql is public.accountability_circle_members, so applying the migrations to an empty database failed with relation "public.circle_members" does not exist.

This PR points both indexes at public.accountability_circle_members. Those are the only two references to the wrong name.

3. Motivation & Context

A fresh database (new Supabase project, local dev, CI) cannot be built from supabase/migrations/. This also blocks reaching the signup failure tracked in #388.

4. Implementation Details

  • supabase/migrations/20260914000000_production_resilience_and_telemetry.sql: 2 lines changed (idx_circle_members_user_status, idx_circle_members_circle_role).
  • I edited the existing migration instead of adding a corrective one, because a fresh database fails at 20260914 before it could reach a later migration. Both statements use IF NOT EXISTS.

5. Testing & Local Validation

  • npm run lint passed with 0 errors
  • npx tsc --noEmit passed with 0 errors
  • npm test passed (66 suites)
  • npm run test:file -- <file> not applicable
  • node scratch/secret-scan.mjs found 0 secrets
  • npm run build not run (SQL-only change)

Manual verification: ran supabase db reset on a fresh local Supabase instance. All migrations applied without error. Before the change it stopped at 20260914 with the error above.

7. Database & Security Impact

  • Database modifications included
    • No new migration file (edits an existing one, see Section 4)
    • No RLS changes
    • No destructive schema changes

…heVicky1#387)

Migration 20260914 indexed public.circle_members, which does not exist,
so applying migrations to a fresh database failed. Point both indexes at
public.accountability_circle_members.

Fixes TheVicky1#387
@vercel

vercel Bot commented Oct 6, 2026

Copy link
Copy Markdown

Someone is attempting to deploy a commit to the Vicky's projects Team on Vercel.

A member of the Team first needs to authorize it.

@TheVicky1
TheVicky1 merged commit 645c821 into TheVicky1:main Oct 6, 2026
3 of 4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix: migration 20260914 fails on a fresh database (relation "public.circle_members" does not exist)

2 participants