Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
7d6bcdfc
Commit
7d6bcdfc
authored
Jan 16, 2021
by
Matija Čupić
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use new steal predicate in TableManagementHelpers
parent
03310908
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
3 deletions
+3
-3
lib/gitlab/database/partitioning_migration_helpers/table_management_helpers.rb
...artitioning_migration_helpers/table_management_helpers.rb
+2
-2
spec/lib/gitlab/database/partitioning_migration_helpers/table_management_helpers_spec.rb
...ioning_migration_helpers/table_management_helpers_spec.rb
+1
-1
No files found.
lib/gitlab/database/partitioning_migration_helpers/table_management_helpers.rb
View file @
7d6bcdfc
...
...
@@ -164,8 +164,8 @@ module Gitlab
"this could indicate the previous partitioning migration has been rolled back."
end
Gitlab
::
BackgroundMigration
.
steal
(
MIGRATION_CLASS_NAME
)
do
|
raw_arguments
|
JobArguments
.
from_array
(
raw_arguments
).
source_table_name
==
table_name
.
to_s
Gitlab
::
BackgroundMigration
.
steal
(
MIGRATION_CLASS_NAME
)
do
|
background_job
|
JobArguments
.
from_array
(
background_job
.
args
.
second
).
source_table_name
==
table_name
.
to_s
end
primary_key
=
connection
.
primary_key
(
table_name
)
...
...
spec/lib/gitlab/database/partitioning_migration_helpers/table_management_helpers_spec.rb
View file @
7d6bcdfc
...
...
@@ -513,7 +513,7 @@ RSpec.describe Gitlab::Database::PartitioningMigrationHelpers::TableManagementHe
context
'finishing pending background migration jobs'
do
let
(
:source_table_double
)
{
double
(
'table name'
)
}
let
(
:raw_arguments
)
{
[
1
,
50_000
,
source_table_double
,
partitioned_table
,
source_column
]
}
let
(
:background_job
)
{
double
(
'background job'
,
args:
raw_arguments
)
}
let
(
:background_job
)
{
double
(
'background job'
,
args:
[
'background jobs'
,
raw_arguments
]
)
}
before
do
allow
(
migration
).
to
receive
(
:table_exists?
).
with
(
partitioned_table
).
and_return
(
true
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment