Skip to content

Conversation

willnode
Copy link

Add support for nonstandard search path migrations

What kind of change does this PR introduce?

Continuation of #1983 and fixes #1729

What is the current behavior?

The current migration script assumes the search path has been set to a custom schema.

ALTER USER supabase_auth_admin SET search_path = '$DB_NAMESPACE';

If this step missed, the default schema for all migrations is public. This should be fine if all tables and enums are prefixed accordingly, but currently it's not. All postgres enum is not prefixed with schema.

What is the new behavior?

All postgres enum will be prefixed with the schema. This should fixes issue #1729 where the migration is broken if search path is not set properly.

This doesn't introduce a breaking change, because if search_path is already set all enums stay on the former search_path .

Additional context

Haven't test. Will test soon.

Add support for nonstandard search path migrations
@willnode willnode requested a review from a team as a code owner May 31, 2025 05:01
cstockton pushed a commit that referenced this pull request Aug 4, 2025
Add support for nonstandard search path migrations
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.

Issue with migrations
1 participant