Postgres-js Migrate - Error: Can't find meta/_journal.json file [SOLVED]

I've gotten drizzle setup and running but I'm unable to run any migrations. I'm using postgres-js and created a migrate.ts file that i'm executing. Here is my code: /lib/migrate.ts
import { drizzle } from 'drizzle-orm/postgres-js';
import { migrate } from 'drizzle-orm/postgres-js/migrator';
import postgres from 'postgres';

const migrationClient = postgres("...", { max: 1 });
migrate(drizzle(migrationClient), { migrationsFolder: '../migrations-folder' });
import { drizzle } from 'drizzle-orm/postgres-js';
import { migrate } from 'drizzle-orm/postgres-js/migrator';
import postgres from 'postgres';

const migrationClient = postgres("...", { max: 1 });
migrate(drizzle(migrationClient), { migrationsFolder: '../migrations-folder' });
I setup my config file: ./crizzle.config.json
{
"out": "./migrations-folder",
"schema": "./lib/drizzle.ts",
"breakpoints": false
}
{
"out": "./migrations-folder",
"schema": "./lib/drizzle.ts",
"breakpoints": false
}
so I've managed to generate some migrations in the migrations-folder but the migrate function is failing. I've tried different databases, locations, tried to trigger the migration through a trpc api call.
9 Replies
Andrii Sherman
Andrii Sherman13mo ago
Could you please show migration folder content?
jannis
jannis13mo ago
I'm having the same issue
jannis
jannis13mo ago
Andrii Sherman
Andrii Sherman13mo ago
are you sure, that migrationsFolder path in migrate function is right?
jannis
jannis13mo ago
I think I've found out what the issue is, even though the index.ts file is several directories deep, you still have to give the file path as if it was in the root directory if that makes sense
gambitboy
gambitboy12mo ago
That's the folder. I'll try what Jannis said now.
gambitboy
gambitboy12mo ago
Its running now, so jannis was right. But it just gets stuck
gambitboy
gambitboy12mo ago
gambitboy
gambitboy12mo ago
It wasn't stuck, the connect just stayed open. I added a close on the .then
Want results from more Discord servers?
Add your server
More Posts