From 6af56a61b8efc3b69ddc372159f7fe03d978c5da Mon Sep 17 00:00:00 2001 From: Pavel Date: Tue, 29 Jul 2025 19:40:43 +0200 Subject: [PATCH] feat: add ignoreComments options testEqualColumns --- packages/tools/src/diffTools.ts | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/packages/tools/src/diffTools.ts b/packages/tools/src/diffTools.ts index 1bb7ee7d5..6093ad666 100644 --- a/packages/tools/src/diffTools.ts +++ b/packages/tools/src/diffTools.ts @@ -59,6 +59,7 @@ export interface DbDiffOptions { ignoreForeignKeyActions?: boolean; ignoreDataTypes?: boolean; + ignoreComments?: boolean; } export function generateTablePairingId(table: TableInfo): TableInfo { @@ -322,11 +323,14 @@ export function testEqualColumns( ); return false; } - if ((a.columnComment || '') != (b.columnComment || '')) { - console.debug( - `Column ${a.pureName}.${a.columnName}, ${b.pureName}.${b.columnName}: different comment: ${a.columnComment}, ${b.columnComment}` - ); - return false; + + if (!opts.ignoreComments) { + if ((a.columnComment || '') != (b.columnComment || '')) { + console.debug( + `Column ${a.pureName}.${a.columnName}, ${b.pureName}.${b.columnName}: different comment: ${a.columnComment}, ${b.columnComment}` + ); + return false; + } } if (!testEqualTypes(a, b, opts)) {