drizzle-team / drizzle-orm

Headless TypeScript ORM with a head. Runs on Node, Bun and Deno. Lives on the Edge and yes, it's a JavaScript ORM too 😅
https://orm.drizzle.team
Apache License 2.0
21.47k stars 486 forks source link

[BUG]: Drizzle migrator doesn't work with uppercase names when creating indexes #2457

Closed adam-arold closed 3 weeks ago

adam-arold commented 3 weeks ago

What version of drizzle-orm are you using?

0.31.0

What version of drizzle-kit are you using?

0.22.1

Describe the Bug

The issue can be reproduced with this commit easily. The problem is that when using the migrator for some reason it doesn't properly execute CREATE UNIQUE INDEX queries. I my case providerId is turned into providerid. I debugged the code and I can't find where it goes wrong, I was able to follow the raw query data into the pg driver and it was still providerId. I can also reproduce this problem with postgres.js so it seems that this is a Drizzle issue. If I take this SQL query and run it against my database without Drizzle it works perfectly. Related Discord discussion is here.

Expected behavior

I expect the migrator to be able to properly execute my query.

Environment & setup

WSL / VS Code

AndriiSherman commented 3 weeks ago

Should be fixed in drizzle-kit@0.22.5