Skip to content
Snippets Groups Projects
Commit 82b982a4 authored by Robin Appelman's avatar Robin Appelman
Browse files

Better unique names for temporary tables

parent 3be26431
No related branches found
No related tags found
No related merge requests found
......@@ -77,6 +77,16 @@ class Migrator {
}
}
/**
* Create a unique name for the temporary table
*
* @param string $name
* @return string
*/
protected function generateTemporaryTableName($name) {
return 'oc_' . $name . '_' . uniqid();
}
/**
* Check the migration of a table on a copy so we can detect errors before messing with the real table
*
......@@ -85,7 +95,7 @@ class Migrator {
*/
protected function checkTableMigrate(Table $table) {
$name = $table->getName();
$tmpName = 'oc_' . uniqid();
$tmpName = $this->generateTemporaryTableName($name);
$this->copyTable($name, $tmpName);
......
......@@ -29,4 +29,12 @@ class OracleMigrator extends NoCheckMigrator {
return $schemaDiff;
}
/**
* @param string $name
* @return string
*/
protected function generateTemporaryTableName($name) {
return 'oc_' . uniqid();
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment