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-kit hardcodes the schema into the migration file #2486

Open adam-arold opened 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 problem is that when I generate a migration file with drizzle-kit it hardcodes the schema into the migration file. This is very bad because I can't run the migration in an environment where I have a schema with a different name (for example on some PaaS providers). What should be done instead is to select the schema based on the connection string and the migration file itself shouldn't have schemas mentioned in them. This configuration option should be part of the drizzle.config file too.

Expected behavior

The generated migration files shouldn't have a schema in them.

Environment & setup

VS Code / WSL