mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 01:56:46 +00:00
fix(core): Ensure valid logger is passed to every migration (no-changelog) (#6563)
This commit is contained in:
committed by
GitHub
parent
db81342b30
commit
9bd49e844a
@@ -5,7 +5,7 @@ import type { QueryRunner } from 'typeorm/query-runner/QueryRunner';
|
|||||||
import config from '@/config';
|
import config from '@/config';
|
||||||
import { getLogger } from '@/Logger';
|
import { getLogger } from '@/Logger';
|
||||||
import { inTest } from '@/constants';
|
import { inTest } from '@/constants';
|
||||||
import type { Migration } from '@db/types';
|
import type { Migration, MigrationContext } from '@db/types';
|
||||||
|
|
||||||
const logger = getLogger();
|
const logger = getLogger();
|
||||||
|
|
||||||
@@ -68,7 +68,13 @@ export const wrapMigration = (migration: Migration) => {
|
|||||||
const dbName = config.getEnv(`database.${dbType === 'mariadb' ? 'mysqldb' : dbType}.database`);
|
const dbName = config.getEnv(`database.${dbType === 'mariadb' ? 'mysqldb' : dbType}.database`);
|
||||||
const tablePrefix = config.getEnv('database.tablePrefix');
|
const tablePrefix = config.getEnv('database.tablePrefix');
|
||||||
const migrationName = migration.name;
|
const migrationName = migration.name;
|
||||||
const context = { tablePrefix, dbType, dbName, migrationName };
|
const context: Omit<MigrationContext, 'queryRunner'> = {
|
||||||
|
tablePrefix,
|
||||||
|
dbType,
|
||||||
|
dbName,
|
||||||
|
migrationName,
|
||||||
|
logger,
|
||||||
|
};
|
||||||
|
|
||||||
const { up, down } = migration.prototype;
|
const { up, down } = migration.prototype;
|
||||||
Object.assign(migration.prototype, {
|
Object.assign(migration.prototype, {
|
||||||
|
|||||||
Reference in New Issue
Block a user