option allowEmptyValue flag

This commit is contained in:
Jan Prochazka
2024-09-12 08:37:09 +02:00
parent 00a6c19f09
commit fb2b47615f
4 changed files with 8 additions and 1 deletions

View File

@@ -435,7 +435,11 @@ function planChangeTableOptions(plan: AlterPlan, oldTable: TableInfo, newTable:
continue; continue;
} }
const name = option.name; const name = option.name;
if (oldTable[name] != newTable[name] && (oldTable[name] || newTable[name])) { if (
oldTable[name] != newTable[name] &&
(oldTable[name] || newTable[name]) &&
(newTable[name] || option.allowEmptyValue)
) {
plan.setTableOption(newTable, name, newTable[name]); plan.setTableOption(newTable, name, newTable[name]);
} }
} }

View File

@@ -54,5 +54,6 @@ export interface SqlDialect {
name: string; name: string;
sqlFormatString: string; sqlFormatString: string;
disabled?: boolean; disabled?: boolean;
allowEmptyValue?: boolean;
}[]; }[];
} }

View File

@@ -128,6 +128,7 @@ const dialect = {
label: 'Comment', label: 'Comment',
name: 'objectComment', name: 'objectComment',
sqlFormatString: '^comment %v', sqlFormatString: '^comment %v',
allowEmptyValue: true,
}, },
]; ];
}, },

View File

@@ -118,6 +118,7 @@ const dialect = {
label: 'Comment', label: 'Comment',
name: 'objectComment', name: 'objectComment',
sqlFormatString: '^comment = %v', sqlFormatString: '^comment = %v',
allowEmptyValue: true,
}, },
]; ];
}, },