DT
Drizzle TeamNinjaBunny

Error when trying to generate a migration schema

anyone any ideas to what the problem is? It was working fine yesterday and now it throws an error when I am trying to generate a migration file. I was updating the relationships/adding a new table and when I tried generate a migration file, this error appeared this is the script i'm running "generate": "cross-env NODE_ENV=development drizzle-kit generate:pg --config=drizzle.config.ts",
import { Config } from "drizzle-kit";

export default {
schema: "./src/modules/drizzle/schemas",
driver: "pg",
dbCredentials: {
connectionString: `postgres://${process.env.PG_USER}:${
process.env.PG_PASSWORD
}@${process.env.PG_HOST}${
process.env.NODE_ENV === "docker" ? `:${process.env.PG_PORT}` : ""
}/${process.env.PG_DATABASE}`,
},
out: "./.drizzle",
} satisfies Config;
import { Config } from "drizzle-kit";

export default {
schema: "./src/modules/drizzle/schemas",
driver: "pg",
dbCredentials: {
connectionString: `postgres://${process.env.PG_USER}:${
process.env.PG_PASSWORD
}@${process.env.PG_HOST}${
process.env.NODE_ENV === "docker" ? `:${process.env.PG_PORT}` : ""
}/${process.env.PG_DATABASE}`,
},
out: "./.drizzle",
} satisfies Config;
``` Reading config file '/munchies/server/drizzle.config.ts' Error: Transform failed with 1 error: errors: [ { detail: undefined, id: '', location: [Object], notes: [], pluginName: '', text: 'Transforming JavaScript decorators to the configured target environment ("es2021") is not supported yet' } ], warnings: [] }
tc
tc190d ago
Hey there, did you ever solve this? I'm running into the same problem.
NinjaBunny
NinjaBunny190d ago
There was something wrong with that version of drizzle if I’m not mistaken It happened a bit ago, but I think that’s what was wrong with the version of drizzle-kit
tc
tc190d ago
gotcha thanks for the response
NinjaBunny
NinjaBunny190d ago
I’m not 100% sure if that was the cause of it, but I know it magically started working again once I updated the package for drizzle-kit
Want results from more Discord servers?
Add your server
More Posts
Modelling self relationsI have a table `categories` with a parent fields: ``` { id: text("id").notNull().primaryKey(), .Issue running migrations to DBI am having an issue running migrations to Neon. I checked that everything is exporting const variabIt is possible to have prepared statements inside transactions?Is there a way to insert prepared queries inside a transaction ?type config findMany or findFirstHi, I've one question i don't find the way to type correctly findMany() Like: export async functionAny idea on how to pass a pool from postgres-pool to drizzle?Passing a single client works, but for better connection management it would help to be able to passHow to get another linked tables count?I am new to Drizzle ORM and I wanted to get another tables data in my api. This is my api ```ts impI created a next auth adapter for postgres-jsThe open PR was not working for me so I created a new adapter. I added it to a starter project so pe.prepare() in Next.js App RouterHello! I'm trying to use PostgresQL prepared statement in the Next.js App Router and I have been getDeleting records w/ sqlite-core.Hello all, hoping to find some clarity/direction. So I'm trying to delete a record using; ```ts expCan't figure out how to design relational queryI have three tables - categories - products - media I want to retrieve products that belong to a padrizzle-zod@0.4.4 with drizzle-orm@0.26.5added drizzle-zod to my project and I am getting this error when starting the dev server - error ./ERR_MODULE_NOT_FOUND while generating migration files```ts import type { Config } from 'drizzle-kit'; export default { schema: './lib/db/schema/*',