mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-18 02:21:13 +00:00
fix(core): Fix the db:revert command (no-changelog) (#6506)
This commit is contained in:
committed by
GitHub
parent
42a9e20e32
commit
8dc828b704
@@ -4,6 +4,8 @@ import { DataSource as Connection } from 'typeorm';
|
||||
import { LoggerProxy } from 'n8n-workflow';
|
||||
import { getLogger } from '@/Logger';
|
||||
import { getConnectionOptions } from '@/Db';
|
||||
import type { Migration } from '@db/types';
|
||||
import { wrapMigration } from '@db/utils/migrationHelpers';
|
||||
import config from '@/config';
|
||||
|
||||
export class DbRevertMigrationCommand extends Command {
|
||||
@@ -34,6 +36,8 @@ export class DbRevertMigrationCommand extends Command {
|
||||
logging: ['query', 'error', 'schema'],
|
||||
};
|
||||
|
||||
(connectionOptions.migrations as Migration[]).forEach(wrapMigration);
|
||||
|
||||
this.connection = new Connection(connectionOptions);
|
||||
await this.connection.initialize();
|
||||
await this.connection.undoLastMigration();
|
||||
|
||||
Reference in New Issue
Block a user