mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-18 21:55:59 +00:00
clickhouse: rename & change column
This commit is contained in:
@@ -5,6 +5,24 @@ class Dumper extends SqlDumper {
|
||||
this.put('^alter ^table %f ^modify ', table);
|
||||
this.put(formatString, optionValue);
|
||||
}
|
||||
|
||||
changeColumn(oldcol, newcol, constraints) {
|
||||
if (oldcol.columnName != newcol.columnName) {
|
||||
this.putCmd('^alter ^table %f ^rename ^column %i ^to %i', oldcol, oldcol.columnName, newcol.columnName);
|
||||
}
|
||||
|
||||
this.put('^alter ^table %f ^modify ^column %i ', newcol, newcol.columnName);
|
||||
this.columnDefinition(newcol);
|
||||
this.endCommand();
|
||||
}
|
||||
|
||||
columnType(dataType) {
|
||||
this.putRaw(dataType);
|
||||
}
|
||||
|
||||
renameColumn(column, newcol) {
|
||||
this.putCmd('^alter ^table %f ^rename ^column %i ^to %i', column, column.columnName, newcol);
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = Dumper;
|
||||
|
||||
Reference in New Issue
Block a user