Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DROP INDEX does not include PG Schema prefix #3866

Merged
merged 2 commits into from
Jan 8, 2025

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

Verified

This commit was signed with the committer’s verified signature.
WaciX Maciej Zieniuk
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

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
@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