Open JoshStwrt opened 3 months ago
Having the same issue here, both on windows and linux, figure a "workaround" changing query
to run
directly in the package
if (statementsToExecute.length === 0) {
(0, import_hanji11.render)(`
[${source_default.blue("i")}] No changes detected`);
} else {
if (!("driver" in credentials2)) {
await db2.query("begin"); //db2.run("begin")
try {
for (const dStmnt of statementsToExecute) {
await db2.query(dStmnt); //db2.run(dStmnt)
}
await db2.query("commit"); //db2.run("commit"))
} catch (e2) {
console.error(e2);
await db2.query("rollback"); //db2.run("rollback")
process.exit(1);
}
} else if (credentials2.driver === "turso") {
await db2.batch(statementsToExecute.map((it) => ({ query: it })));
}
(0, import_hanji11.render)(`[${source_default.green("\u2713")}] Changes applied`);
}
Working as expected on Drizzle-Kit 0.22.8, guessing is because they are using run()
instead of query()
if (statementsToExecute.length === 0) {
(0, import_hanji11.render)(`
[${source_default.blue("i")}] No changes detected`);
} else {
for (const dStmnt of statementsToExecute) {
await db2.run(dStmnt);
}
(0, import_hanji11.render)(`[${source_default.green("\u2713")}] Changes applied`);
}
}
There's also another issue related to this that was open in the drizzle orm repository instead
Exactly the same issue. But somehow I can migrate and have my database tables created. So I use migrate instead of push, hope it works for you too.
Also having this issue, unfortunately push
is completely unusable in my case
also have the same issue on 0.24.2. works on 0.22.8 though.
I get the following error when trying to push schema changes (
drizzle-kit push
)user.ts
drizzle.config.ts
Versions
drizzle-kit: 0.23.0 node: 22.4.1