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.52k stars 487 forks source link

[BUG]: drizzle-kit push reads all files in schema folder instead of only index.ts #2572

Open stabildev opened 3 days ago

stabildev commented 3 days ago

What version of drizzle-orm are you using?

0.31.2

What version of drizzle-kit are you using?

0.22.8

Describe the Bug

I store SQL files in my schema folder.

Expected behavior

export default defineConfig({
  schema: "./src/server/db/schema",
  ...
});

should be equivalent to

export default defineConfig({
  schema: "./src/server/db/schema/index.ts",
  ...
});

Instead, drizzle-kit tries to read the schema from the colocated SQL files that are not exported from index.ts

Environment & setup

No response