Closed webdevcody closed 4 months ago
drizzle-orm
0.30.9
drizzle-kit
0.20.17
My config
import { env } from "@/env"; import { defineConfig } from "drizzle-kit"; export default defineConfig({ schema: "./src/db/schema.ts", driver: "turso", out: "./drizzle", dbCredentials: { url: env.DATABASE_URL, authToken: env.DATABASE_AUTH_TOKEN, }, verbose: true, strict: true, });
I had this schema:
export const groups = sqliteTable("group", { id: text("id") .primaryKey() .$defaultFn(() => randomUUID()), name: text("name").notNull(), description: text("description").notNull(), });
generated and migrated fine
then I added this column
userId: text("userId") .notNull() .references(() => users.id, { onDelete: "cascade" }),
which generated this migration
ALTER TABLE group ADD `userId` text NOT NULL REFERENCES user(id);
this script is invalid for sqlite. I had to wrap group with group. Not sure why.
group
No response
Could be because "group" is a reserved word?
"group"
Should work fine on the latest versions, which are 0.32.0 at the time of this message
What version of
drizzle-orm
are you using?0.30.9
What version of
drizzle-kit
are you using?0.20.17
Describe the Bug
My config
I had this schema:
generated and migrated fine
then I added this column
which generated this migration
this script is invalid for sqlite. I had to wrap group with
group
. Not sure why.Expected behavior
No response
Environment & setup
No response