use of org.jkiss.dbeaver.ext.mysql.model.MySQLTableColumn in project dbeaver by serge-rider.
the class MySQLTableColumnManager method addObjectModifyActions.
@Override
protected void addObjectModifyActions(List<DBEPersistAction> actionList, ObjectChangeCommand command) {
final MySQLTableColumn column = command.getObject();
actionList.add(new SQLDatabasePersistAction("Modify column", //$NON-NLS-1$ //$NON-NLS-2$
"ALTER TABLE " + column.getTable().getFullyQualifiedName(DBPEvaluationContext.DDL) + " MODIFY COLUMN " + getNestedDeclaration(column.getTable(), command)));
}
use of org.jkiss.dbeaver.ext.mysql.model.MySQLTableColumn in project dbeaver by serge-rider.
the class MySQLTableColumnManager method addObjectRenameActions.
@Override
protected void addObjectRenameActions(List<DBEPersistAction> actions, ObjectRenameCommand command) {
final MySQLTableColumn column = command.getObject();
actions.add(new SQLDatabasePersistAction("Rename column", "ALTER TABLE " + column.getTable().getFullyQualifiedName(DBPEvaluationContext.DDL) + " CHANGE " + DBUtils.getQuotedIdentifier(column.getDataSource(), command.getOldName()) + " " + getNestedDeclaration(column.getTable(), command)));
}
use of org.jkiss.dbeaver.ext.mysql.model.MySQLTableColumn in project dbeaver by dbeaver.
the class MySQLTableColumnManager method getNestedDeclaration.
@Override
public StringBuilder getNestedDeclaration(MySQLTableBase owner, DBECommandAbstract<MySQLTableColumn> command, Map<String, Object> options) {
StringBuilder decl = super.getNestedDeclaration(owner, command, options);
final MySQLTableColumn column = command.getObject();
if (!CommonUtils.isEmpty(column.getExtraInfo())) {
// $NON-NLS-1$
decl.append(" ").append(column.getExtraInfo());
}
if (column.isAutoGenerated() && (CommonUtils.isEmpty(column.getExtraInfo()) || !column.getExtraInfo().toLowerCase(Locale.ENGLISH).contains(MySQLConstants.EXTRA_AUTO_INCREMENT))) {
// $NON-NLS-1$
decl.append(" AUTO_INCREMENT");
}
if (!CommonUtils.isEmpty(column.getComment())) {
// $NON-NLS-1$ //$NON-NLS-2$
decl.append(" COMMENT ").append(SQLUtils.quoteString(column, column.getComment()));
}
return decl;
}
use of org.jkiss.dbeaver.ext.mysql.model.MySQLTableColumn in project dbeaver by dbeaver.
the class MySQLTableColumnManager method addObjectRenameActions.
@Override
protected void addObjectRenameActions(List<DBEPersistAction> actions, ObjectRenameCommand command, Map<String, Object> options) {
final MySQLTableColumn column = command.getObject();
actions.add(new SQLDatabasePersistAction("Rename column", "ALTER TABLE " + column.getTable().getFullyQualifiedName(DBPEvaluationContext.DDL) + " CHANGE " + DBUtils.getQuotedIdentifier(column.getDataSource(), command.getOldName()) + " " + getNestedDeclaration(column.getTable(), command, options)));
}
use of org.jkiss.dbeaver.ext.mysql.model.MySQLTableColumn in project dbeaver by dbeaver.
the class MySQLTableColumnManager method addObjectModifyActions.
@Override
protected void addObjectModifyActions(List<DBEPersistAction> actionList, ObjectChangeCommand command, Map<String, Object> options) {
final MySQLTableColumn column = command.getObject();
actionList.add(new SQLDatabasePersistAction("Modify column", // $NON-NLS-1$ //$NON-NLS-2$
"ALTER TABLE " + column.getTable().getFullyQualifiedName(DBPEvaluationContext.DDL) + " MODIFY COLUMN " + getNestedDeclaration(column.getTable(), command, options)));
}
Aggregations