-
When running the script below, the npx ts-node src/migrate.ts src/migrate.ts import { drizzle } from "drizzle-orm/node-postgres";
import { migrate } from "drizzle-orm/node-postgres/migrator";
import { Client } from "pg";
async function runMigrations() {
const client = new Client({
connectionString: "postgres://user:pass@localhost:5432/drizzledb",
});
await client.connect();
const db = drizzle(client);
console.log("Started");
await migrate(db, { migrationsFolder: "src/migrations" });
console.log("Completed");
}
runMigrations();
/**
* returns
*
* Started
* Completed
* <keeps waiting>
*/ tsconfig.json {
"compilerOptions": {
"esModuleInterop": true,
"forceConsistentCasingInFileNames": true,
"isolatedModules": true,
"moduleResolution": "node",
"preserveWatchOutput": true,
"skipLibCheck": true,
"noEmit": true,
"strict": true
},
"include": [
"/**/*.ts"
],
"exclude": [
"node_modules"
]
} |
Beta Was this translation helpful? Give feedback.
Answered by
VaZark
Jul 14, 2023
Replies: 1 comment
-
Never mind. I just had an open DB connection |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
VaZark
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Never mind. I just had an open DB connection