Replies: 1 comment 1 reply
-
I´m facing the same issue right now and wrote a script to apply the migrations (i´m using postgres-js): import 'dotenv/config';
import postgres from 'postgres';
import { drizzle } from 'drizzle-orm/postgres-js';
import { migrate } from 'drizzle-orm/postgres-js/migrator';
const client = postgres(process.env.DATABASE_URL, { max: 1 });
await migrate(drizzle(client, { logger: true }), {
migrationsFolder: 'drizzle',
}); I added a script to package.json |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I'm trying to figure out how to apply migrations using drizzle-kit but I'm stuck.
This is the procedure that I used:
First I start introspecting an exiting db:
npx drizzle-kit introspect:pg --connectionString=postgres://root:root@localhost:5432/test --out=database/migrations
with the output:
Then I run the migration command:
npx drizzle-kit generate:pg
with the output:
Then I apply the migrations with the command:
npx drizzle-kit up:pg
but the output is:
Reading drizzle.config.json Everything's fine 🐶🔥
my
drizzle.config.json
:how am I supposed to apply the migrations that drizzle-kit created?
Beta Was this translation helpful? Give feedback.
All reactions