No schema changes, nothing to migrate 😴

I'm trying to run a very basic setup and drizzle-kit doesn't pick up on the schema. I've been... fighting this for a bit. Basically out of ideas.
// ./db/schema.ts
import { integer, sqliteTable } from "drizzle-orm/sqlite-core";

export const test = sqliteTable("test", {
id: integer("id").primaryKey(),
});
// ./db/schema.ts
import { integer, sqliteTable } from "drizzle-orm/sqlite-core";

export const test = sqliteTable("test", {
id: integer("id").primaryKey(),
});
I run the command npx drizzle-kit generate --dialect=postgresql --schema=./db/schema.ts I get the output:
0 tables


No schema changes, nothing to migrate 😴
0 tables


No schema changes, nothing to migrate 😴
Not sure what I should be doing different. I've also tried this with config files, with files in the root, but I keep getting the same thing.
"devDependencies": {
"@types/pg": "^8.11.10",
"dotenv": "^16.4.7",
"drizzle-kit": "^0.29.1",
"tsx": "^4.19.2",
"typescript": "^5.6.3"
},
"dependencies": {
"drizzle-orm": "^0.37.0",
"pg": "^8.13.1",
}
"devDependencies": {
"@types/pg": "^8.11.10",
"dotenv": "^16.4.7",
"drizzle-kit": "^0.29.1",
"tsx": "^4.19.2",
"typescript": "^5.6.3"
},
"dependencies": {
"drizzle-orm": "^0.37.0",
"pg": "^8.13.1",
}
5 Replies
Vâjhâtz
VâjhâtzOP•2w ago
Bump? I'm gonna give this another try tomorrow but will probably move away from drizzle if it doesn't work. I have two other projects that use drizzle and very happy with it, but something happened now (possibly my mistake?) and it just doesn't work.
François
François•2w ago
Are you by any chance using bun for this one project? I had the same issue months ago using bun only. Not sure if it is fixed by now. Maybe it is not and you are running into it now too Oh Just saw you are using npx Nevermind then, sorry
Vâjhâtz
VâjhâtzOP•2w ago
Maybe I should be using bun 😅
Mario564
Mario564•2w ago
You're declaring your schema using SQLite tables and data types but you seem to have PG set as the dialect and pg as the driver. So, are you using Postgres or SQLite? If you're using Postgres, change the imports from sqlite-core to pg-core. If you're using SQLite, set SQLite as the dialect either in your drizzle.config.ts file or in the corresponding commands, and remove pg from your dependencies and install a SQLite driver instead
Vâjhâtz
VâjhâtzOP•7d ago
Oh man... I wish I had opened this sooner 😅 this was exactly it! I just picked up debugging this today and realized my mistake and came here to reply in case anyone else read. But you beat me to it by 6 days. Thanks a lot for giving it your time! 🙏
Want results from more Discord servers?
Add your server