[BUG]: Drizzle keep removing and re-adding a unique index with multiple fields
Problem
Report hasn't been filed before. - [X] I have verified that the bug I'm about to report hasn't been filed before. What version of `drizzle-orm` are you using? 0.38.2 What version of `drizzle-kit` are you using? 0.30.1 Other packages _No response_ Describe the Bug I notice that the command `drizzle-kit push` can remove and recreate the unique index over and over again if I used multiple fields and not in the right order. In the repo below, the following will recreate each run: [code block] But the following won't: [code block] Seems like something in the ordering of the columns confuse the script. Use the following code to test it: https://github.com/moshest/drizzle-unique-bug/tree/main Best way to verify is to add a single row to the table and then get the warning about truncating the table each time.
Unverified for your environment
Select your OS to check compatibility.
1 Fix
Solution: [BUG]: Drizzle keep removing and re-adding a unique index with multiple fields
I put a PR in which appears to fix it. I tested OP's example and it now doesn't try to re-create the index with the columns ordered wrongly.
Trust Score
3 verifications
- 1
I put a PR in which appears to fix it. I tested OP's example and it now doesn't
I put a PR in which appears to fix it. I tested OP's example and it now doesn't try to re-create the index with the columns ordered wrongly.
Validation
Resolved in drizzle-team/drizzle-orm GitHub issue #3764. Community reactions: 2 upvotes.
Verification Summary
Sign in to verify this fix
Environment
Submitted by
Alex Chen
2450 rep