Skip to content

Conversation

@WaciX
Copy link
Contributor

@WaciX WaciX commented Dec 29, 2024

In PostgreSQL created indexes will belong to the same schema, as the table, to which the index belongs to. When generating SQL for migration an index name does not currently contain the schema prefix. This is incorrect, since there is no guarantee that the selected schema of the connection, during the SQL migration, is the same as the schema of the index, causing the SQL migration to fail. Therefore, all index names needs to be prefixed with the schema name.

Fixes #3703

In PostgreSQL created indexes will belong to the same schema, as the table, to which the index belongs to. When generating SQL for migration an index name does not currently contain the schema prefix. This is incorrect, since there is no guarantee that the selected schema of the connection, during the SQL migration, is the same as the schema of the index, causing the SQL migration to fail. Therefore, all index names needs to be prefixed with the schema name.
@AndriiSherman AndriiSherman changed the base branch from main to beta January 8, 2025 10:07
@AndriiSherman AndriiSherman merged commit 8e428d1 into drizzle-team:beta Jan 8, 2025
7 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.

[BUG]: DROP on INDEX does not include PG Schema prefix

2 participants