Replies: 2 comments 1 reply
-
I added
on top of migration file (.sql file in /migrations folder) |
Beta Was this translation helpful? Give feedback.
1 reply
-
It looks like you forgot to add your schema to your // db.ts
import { drizzle } from "drizzle-orm/node-postgres";
import { migrate } from "drizzle-orm/node-postgres/migrator";
import { Pool } from "pg";
import * as schema from "./schema"; // Import all tables
const pool = new Pool({
connectionString: process.env.POSTGRES_DB_URL,
});
const db = drizzle(pool, { schema, logger: true }); // Add schema here
// ... |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Using pg-core with
"drizzle-orm": "^0.25.2",
and my followingdb.ts
looks like the following:I run the migration so my
drizzle/
folder has a .sql file. My database doesn't have any tables though. I assume during the first route query, thedb.ts
file will run and create the tables needed. However, I'm getting this error:Beta Was this translation helpful? Give feedback.
All reactions