bool MysqlRenameColumnService::execute(const Commands::RenameColumn &renameColumn, const Structure::Column &originalColumn, const CommandExecutionContext &context) { Structure::Column modifiedColumn(renameColumn.newName(), originalColumn.type(), originalColumn.defaultValue(), originalColumn.attributes()); const QString alterQuery = QString("ALTER TABLE %1 CHANGE COLUMN %2 %3") .arg(context.helperRepository().quoteService().quoteTableName(renameColumn.tableName())) .arg(renameColumn.oldName()) .arg(context.helperRepository().columnService().generateColumnDefinitionSql(modifiedColumn)); return CommandExecution::BaseCommandExecutionService::executeQuery(alterQuery, context); }
bool BaseSqlDropTableService::execute(const Commands::DropTable &dropTable, const CommandExecutionContext &context) { const QString dropQuery = QString("DROP TABLE %1") .arg(context.helperRepository().quoteService().quoteTableName(dropTable.tableName())); return CommandExecution::BaseCommandExecutionService::executeQuery(dropQuery, context); }