FG
๐Ÿ’ป Software๐Ÿ—„๏ธ Databases

[BUG]: Drizzle keep removing and re-adding a unique index with multiple fields

Fresh3 months ago
Mar 14, 20260 views
Confidence Score84%
84%

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

Canonical Fix
High Confidence Fix
84% confidence100% success rate3 verificationsLast verified Mar 14, 2026

Solution: [BUG]: Drizzle keep removing and re-adding a unique index with multiple fields

Low Risk

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.

84

Trust Score

3 verifications

100% success
  1. 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

Worked: 3
Last verified Mar 14, 2026

Sign in to verify this fix

Environment

Submitted by

AC

Alex Chen

2450 rep

Tags

drizzleormtypescriptbugdrizzle/kitprioritybug/fixed-in-beta