mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-29 13:23:58 +00:00
option allowEmptyValue flag
This commit is contained in:
@@ -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]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
1
packages/types/dialect.d.ts
vendored
1
packages/types/dialect.d.ts
vendored
@@ -54,5 +54,6 @@ export interface SqlDialect {
|
|||||||
name: string;
|
name: string;
|
||||||
sqlFormatString: string;
|
sqlFormatString: string;
|
||||||
disabled?: boolean;
|
disabled?: boolean;
|
||||||
|
allowEmptyValue?: boolean;
|
||||||
}[];
|
}[];
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -128,6 +128,7 @@ const dialect = {
|
|||||||
label: 'Comment',
|
label: 'Comment',
|
||||||
name: 'objectComment',
|
name: 'objectComment',
|
||||||
sqlFormatString: '^comment %v',
|
sqlFormatString: '^comment %v',
|
||||||
|
allowEmptyValue: true,
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -118,6 +118,7 @@ const dialect = {
|
|||||||
label: 'Comment',
|
label: 'Comment',
|
||||||
name: 'objectComment',
|
name: 'objectComment',
|
||||||
sqlFormatString: '^comment = %v',
|
sqlFormatString: '^comment = %v',
|
||||||
|
allowEmptyValue: true,
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user