mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-28 04:56:00 +00:00
fixed clickhouse default value handling
This commit is contained in:
@@ -45,6 +45,7 @@ class Analyser extends DatabaseAnalyser {
|
|||||||
.filter((col) => col.pureName == table.pureName)
|
.filter((col) => col.pureName == table.pureName)
|
||||||
.map((col) => ({
|
.map((col) => ({
|
||||||
...col,
|
...col,
|
||||||
|
defaultValue: col.defaultValue ? col.defaultValue : undefined,
|
||||||
...extractDataType(col.dataType),
|
...extractDataType(col.dataType),
|
||||||
})),
|
})),
|
||||||
primaryKey: table.primaryKeyColumns
|
primaryKey: table.primaryKeyColumns
|
||||||
|
|||||||
@@ -13,6 +13,9 @@ class Dumper extends SqlDumper {
|
|||||||
|
|
||||||
this.put('^alter ^table %f ^modify ^column %i ', newcol, newcol.columnName);
|
this.put('^alter ^table %f ^modify ^column %i ', newcol, newcol.columnName);
|
||||||
this.columnDefinition(newcol);
|
this.columnDefinition(newcol);
|
||||||
|
if (oldcol.defaultValue != null && newcol.defaultValue == null) {
|
||||||
|
this.put(' ^remove ^default ');
|
||||||
|
}
|
||||||
this.endCommand();
|
this.endCommand();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user