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
24.68k stars 651 forks source link

[BUG]: Bun scripts giving outputs #1243

Open resyfer opened 1 year ago

resyfer commented 1 year ago

What version of drizzle-orm are you using?

0.28.6

What version of drizzle-kit are you using?

0.19.13

Describe the Bug

I was wondering why these two have different outputs. generate1 creates a drizzle directory without any sql files, but generate2 creates them properly.

package.json:

// ...
"scripts": {
    // ...
    "generate1": "bun --bun drizzle-kit generate:pg",
    "generate2": "drizzle-kit generate:pg",
}

Output:

╭─resyfer@fedora ~/projects/kage/server ‹main●› 
╰─$ rm -rf drizzle
╭─resyfer@fedora ~/projects/kage/server ‹main●› 
╰─$ bun generate1 
$ bun --bun drizzle-kit generate:pg
[0.13ms] ".env"
drizzle-kit: v0.19.13
drizzle-orm: v0.28.6

No config path provided, using default 'drizzle.config.ts'
Reading config file '/home/resyfer/projects/kage/server/drizzle.config.ts'
0 tables

No schema changes, nothing to migrate 😴
╭─resyfer@fedora ~/projects/kage/server ‹main●› 
╰─$ rm -rf drizzle
╭─resyfer@fedora ~/projects/kage/server ‹main●› 
╰─$ bun generate2 
$ drizzle-kit generate:pg
drizzle-kit: v0.19.13
drizzle-orm: v0.28.6

No config path provided, using default 'drizzle.config.ts'
Reading config file '/home/resyfer/projects/kage/server/drizzle.config.ts'
8 tables
group 2 columns 0 indexes 0 fks
organization 2 columns 0 indexes 0 fks
package 5 columns 0 indexes 1 fks
release 9 columns 0 indexes 1 fks
user 5 columns 0 indexes 0 fks
contributor 2 columns 0 indexes 2 fks
dependencies 3 columns 0 indexes 2 fks
member 2 columns 0 indexes 2 fks

1 enums
PKG_TYPE [LIBRARY, BINARY]

[✓] Your SQL migration file ➜ drizzle/0000_demonic_toad_men.sql 🚀

drizzle.config.ts:

import type { Config } from "drizzle-kit";

export default {
  schema: ["./src/models/**/schema.ts", "./src/models/joins/*.ts"],
  out: "./drizzle",
  driver: "pg",
  dbCredentials: {
    connectionString: process.env.DB_URI!,
  },
} satisfies Config;

Expected behavior

No response

Environment & setup

Fedora 38

fran-cadenas-fu commented 11 months ago

Any advance on this issue ?

basemkhirat commented 10 months ago

I have this issue when running the drizzle-kit cli inside a docker container.