We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e29c773 commit ef34ff3Copy full SHA for ef34ff3
source/util/migration_handler.ts
@@ -1,12 +1,7 @@
1
+import { Pool } from 'pg'
2
import { migrate } from 'postgres-migrations'
3
4
export async function applyMigrations(config: any): Promise<void> {
- const dbConfig = {
5
- database: config['database'] || 'postgres',
6
- user: config['user'] || 'postgres',
7
- password: config['password'] || 'postgres',
8
- host: config['host'] || 'localhost',
9
- port: config['port'] || 5432,
10
- }
11
- await migrate(dbConfig, __dirname + '/migrations')
+ const pool = new Pool(config)
+ await migrate({ client: pool }, __dirname + '/migrations')
12
}
0 commit comments