Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
our_own_cloud_project
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
die_coolen_jungs
our_own_cloud_project
Commits
82b982a4
Commit
82b982a4
authored
11 years ago
by
Robin Appelman
Browse files
Options
Downloads
Patches
Plain Diff
Better unique names for temporary tables
parent
3be26431
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
lib/private/db/migrator.php
+11
-1
11 additions, 1 deletion
lib/private/db/migrator.php
lib/private/db/oraclemigrator.php
+8
-0
8 additions, 0 deletions
lib/private/db/oraclemigrator.php
with
19 additions
and
1 deletion
lib/private/db/migrator.php
+
11
−
1
View file @
82b982a4
...
...
@@ -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
);
...
...
This diff is collapsed.
Click to expand it.
lib/private/db/oraclemigrator.php
+
8
−
0
View file @
82b982a4
...
...
@@ -29,4 +29,12 @@ class OracleMigrator extends NoCheckMigrator {
return
$schemaDiff
;
}
/**
* @param string $name
* @return string
*/
protected
function
generateTemporaryTableName
(
$name
)
{
return
'oc_'
.
uniqid
();
}
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment