mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-26 23:46:23 +00:00
clickhouse + mysql: modify table option
This commit is contained in:
@@ -1,6 +1,10 @@
|
||||
const { SqlDumper } = require('dbgate-tools');
|
||||
|
||||
class Dumper extends SqlDumper {
|
||||
setTableOptionCore(table, optionName, optionValue, formatString) {
|
||||
this.put('^alter ^table %f ^modify ', table);
|
||||
this.put(formatString, optionValue);
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = Dumper;
|
||||
|
||||
@@ -74,7 +74,7 @@ const dialect = {
|
||||
},
|
||||
|
||||
getTableFormOptions(intent) {
|
||||
const isNewTable = intent == 'newTableForm';
|
||||
const isNewTable = intent == 'newTableForm' || intent == 'sqlCreateTable';
|
||||
return [
|
||||
{
|
||||
type: isNewTable ? 'dropdowntext' : 'text',
|
||||
|
||||
@@ -105,21 +105,19 @@ const dialect = {
|
||||
},
|
||||
|
||||
getTableFormOptions(intent) {
|
||||
const isNewTable = intent == 'newTableForm';
|
||||
return [
|
||||
{
|
||||
type: isNewTable ? 'dropdowntext' : 'text',
|
||||
type: 'dropdowntext',
|
||||
options: this.getSupportedEngines(),
|
||||
label: 'Engine',
|
||||
name: 'tableEngine',
|
||||
sqlFormatString: '^engine = %s',
|
||||
disabled: !isNewTable,
|
||||
},
|
||||
{
|
||||
type: 'text',
|
||||
label: 'Comment',
|
||||
name: 'objectComment',
|
||||
sqlFormatString: '^comment %v',
|
||||
sqlFormatString: '^comment = %v',
|
||||
},
|
||||
];
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user