Open jennnx opened 7 months ago
I'm facing an issue like that using drizzle-orm@0.30.10 + drizzle-kit@0.21.2.
schema before:
import { integer, sqliteTable, text } from "drizzle-orm/sqlite-core";
export const users = sqliteTable("users", {
id: integer("id").primaryKey({ autoIncrement: true }).notNull(),
fullName: text("fullName").notNull(),
});
schema after:
export const users = sqliteTable("users", {
id: integer("id").primaryKey({ autoIncrement: true }).notNull(),
fullName: text("fullName").notNull(),
birthday: integer("birthday", { mode: "timestamp" }),
});
Yes.
Same issue. It has put a breakpoint solely for a comment and as a such an empty statement.
Weird thing is that I tried looking in to where the issue is or even what code creates that comment but couldn't find it.
2 way to solve this:
1.Stop adding breakpoints for comments.
1 is obviously highly preferred.
If anyone could point me in the right direction I can do the work. I check this repo and the drizzle-kit-mirror repo but its in neither?
What version of
drizzle-orm
are you using?0.29.1
What version of
drizzle-kit
are you using?0.20.7
Describe the Bug
Generating migration files for libsql will sometimes produce incorrect -->statement-breakpoints.
For example
The generated migration files will produce a
error when applying a migration with
drizzle-orm/libsql/migrator
.Workaround:
Manually deleting the two statement breakpoints highlighted above fixes the issue.
[Note]
This bug forced me to read the autogenerated comments, which informed me that migrations for these constraints will be have to applied manually (by cloning the table, renaming it, dropping it, and renaming again). I think having an explicit warning during drizzle-kit generate:sqlite would be helpful!
Expected behavior
Migrations should apply without error
Environment & setup
No response