From 4d261977b0b58931991466350201ef443e9068a8 Mon Sep 17 00:00:00 2001 From: Mikhail Yarmaliuk Date: Wed, 21 Jun 2023 16:50:32 +0200 Subject: [PATCH] fix: create db --- src/helpers/create-db.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/helpers/create-db.ts b/src/helpers/create-db.ts index fcb9093..34238cb 100644 --- a/src/helpers/create-db.ts +++ b/src/helpers/create-db.ts @@ -5,7 +5,12 @@ import { createConnection } from 'typeorm'; * Create DB if not exist */ const createDbIfNotExists = async ({ database, ...options }: ConnectionOptions): Promise => { - 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}');`, );