Always order by all values, to make sure all entries are copied correctly

Signed-off-by: Joas Schilling <coding@schilljs.com>
This commit is contained in:
Joas Schilling 2017-07-19 13:20:24 +02:00
parent 1b7c1ad5c0
commit e023899078
No known key found for this signature in database
GPG key ID: E166FD8976B3BAC8

View file

@ -324,18 +324,13 @@ class ConvertType extends Command implements CompletionAwareInterface {
$orderColumns = $table->getPrimaryKeyColumns();
} catch (DBALException $e) {
$orderColumns = [];
}
foreach ($table->getIndexes() as $index) {
if ($index->isUnique()) {
$orderColumns = array_merge($orderColumns, $index->getUnquotedColumns());
foreach ($table->getColumns() as $column) {
$orderColumns[] = $column->getName();
}
}
$orderColumns = array_unique($orderColumns);
if (!empty($orderColumns)) {
foreach ($orderColumns as $column) {
$query->addOrderBy($column);
}
foreach ($orderColumns as $column) {
$query->addOrderBy($column);
}
$insertQuery = $toDB->getQueryBuilder();