Skip to content

Commit

Permalink
fix: create db
Browse files Browse the repository at this point in the history
  • Loading branch information
MatthewPattell committed Jun 21, 2023
1 parent 3e2e969 commit 4d26197
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/helpers/create-db.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,12 @@ import { createConnection } from 'typeorm';
* Create DB if not exist
*/
const createDbIfNotExists = async ({ database, ...options }: ConnectionOptions): Promise<void> => {
const connection = await createConnection(options as ConnectionOptions);
const connection = await createConnection({
...options,
migrationsRun: false,
synchronize: false,
logging: false,
} as ConnectionOptions);
const result = await connection.manager.query(
`SELECT * FROM pg_database WHERE lower(datname) = lower('${database as string}');`,
);
Expand Down

0 comments on commit 4d26197

Please sign in to comment.