mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 01:56:46 +00:00
refactor: Upgrade typeorm to 0.3.x (#5151)
This commit is contained in:
committed by
GitHub
parent
6608e69457
commit
0a5ab560b1
@@ -1,5 +1,5 @@
|
||||
import 'tsconfig-paths/register';
|
||||
import { createConnection } from 'typeorm';
|
||||
import { DataSource as Connection } from 'typeorm';
|
||||
import config from '@/config';
|
||||
import { getBootstrapDBOptions } from './integration/shared/testDb';
|
||||
|
||||
@@ -7,7 +7,8 @@ export default async () => {
|
||||
const dbType = config.getEnv('database.type').replace(/db$/, '');
|
||||
if (dbType !== 'postgres' && dbType !== 'mysql') return;
|
||||
|
||||
const connection = await createConnection(getBootstrapDBOptions(dbType));
|
||||
const connection = new Connection(getBootstrapDBOptions(dbType));
|
||||
await connection.initialize();
|
||||
|
||||
const query =
|
||||
dbType === 'postgres' ? 'SELECT datname as "Database" FROM pg_database' : 'SHOW DATABASES';
|
||||
@@ -20,5 +21,5 @@ export default async () => {
|
||||
|
||||
const promises = databases.map((dbName) => connection.query(`DROP DATABASE ${dbName};`));
|
||||
await Promise.all(promises);
|
||||
await connection.close();
|
||||
await connection.destroy();
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user