mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-18 02:21:13 +00:00
refactor: Upgrade typeorm to 0.3.x (#5151)
This commit is contained in:
committed by
GitHub
parent
6608e69457
commit
0a5ab560b1
@@ -1,7 +1,7 @@
|
||||
/* eslint-disable @typescript-eslint/no-unsafe-member-access */
|
||||
/* eslint-disable no-console */
|
||||
import { Command, flags } from '@oclif/command';
|
||||
import { Connection, ConnectionOptions, createConnection } from 'typeorm';
|
||||
import { DataSource as Connection, DataSourceOptions as ConnectionOptions } from 'typeorm';
|
||||
import { LoggerProxy } from 'n8n-workflow';
|
||||
|
||||
import { getLogger } from '@/Logger';
|
||||
@@ -34,11 +34,12 @@ export class DbRevertMigrationCommand extends Command {
|
||||
dropSchema: false,
|
||||
logging: ['query', 'error', 'schema'],
|
||||
};
|
||||
connection = await createConnection(connectionOptions);
|
||||
connection = new Connection(connectionOptions);
|
||||
await connection.initialize();
|
||||
await connection.undoLastMigration();
|
||||
await connection.close();
|
||||
await connection.destroy();
|
||||
} catch (error) {
|
||||
if (connection) await connection.close();
|
||||
if (connection?.isInitialized) await connection.destroy();
|
||||
|
||||
console.error('Error reverting last migration. See log messages for details.');
|
||||
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument
|
||||
|
||||
Reference in New Issue
Block a user