Merge pull request #9292 from owncloud/issue/9161
Use get random bytes as uniqeid() is not unique in some cases
This commit is contained in:
commit
88e6f5c318
|
@ -84,7 +84,7 @@ class Migrator {
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
protected function generateTemporaryTableName($name) {
|
protected function generateTemporaryTableName($name) {
|
||||||
return 'oc_' . $name . '_' . uniqid();
|
return 'oc_' . $name . '_' . \OCP\Util::generateRandomBytes(13);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -133,7 +133,7 @@ class Migrator {
|
||||||
$indexName = $index->getName();
|
$indexName = $index->getName();
|
||||||
} else {
|
} else {
|
||||||
// avoid conflicts in index names
|
// avoid conflicts in index names
|
||||||
$indexName = 'oc_' . uniqid();
|
$indexName = 'oc_' . \OCP\Util::generateRandomBytes(13);
|
||||||
}
|
}
|
||||||
$newIndexes[] = new Index($indexName, $index->getColumns(), $index->isUnique(), $index->isPrimary());
|
$newIndexes[] = new Index($indexName, $index->getColumns(), $index->isUnique(), $index->isPrimary());
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue