BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
73c7b968
Commit
73c7b968
authored
Jul 18, 2017
by
Grzegorz Bizon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove migration dependency from stage_id migration
parent
2930c0e3
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
5 deletions
+3
-5
20170710083355_clean_stage_id_reference_migration.rb
...rate/20170710083355_clean_stage_id_reference_migration.rb
+1
-4
clean_stage_id_reference_migration_spec.rb
spec/migrations/clean_stage_id_reference_migration_spec.rb
+2
-1
No files found.
db/migrate/20170710083355_clean_stage_id_reference_migration.rb
View file @
73c7b968
require
Rails
.
root
.
join
(
'db'
,
'post_migrate'
,
'20170628080858_migrate_stage_id_reference_in_background'
)
class
CleanStageIdReferenceMigration
<
ActiveRecord
::
Migration
include
Gitlab
::
Database
::
MigrationHelpers
...
...
@@ -11,8 +9,7 @@ class CleanStageIdReferenceMigration < ActiveRecord::Migration
# `MigrateStageIdReferenceInBackground` background migration cleanup.
#
def
up
Gitlab
::
BackgroundMigration
.
steal
(
MigrateStageIdReferenceInBackground
::
MIGRATION
)
Gitlab
::
BackgroundMigration
.
steal
(
'MigrateBuildStageIdReference'
)
end
def
down
...
...
spec/migrations/clean_stage_id_reference_migration_spec.rb
View file @
73c7b968
require
'spec_helper'
require
Rails
.
root
.
join
(
'db'
,
'migrate'
,
'20170710083355_clean_stage_id_reference_migration.rb'
)
require
Rails
.
root
.
join
(
'db'
,
'post_migrate'
,
'20170628080858_migrate_stage_id_reference_in_background'
)
describe
CleanStageIdReferenceMigration
,
:migration
,
:sidekiq
,
:redis
do
let
(
:migration
)
{
MigrateStageIdReferenceInBackground
::
MIGRATION
}
context
'when there are pending background migrations'
do
it
'processes
enqueued
jobs synchronously'
do
it
'processes
pending
jobs synchronously'
do
Sidekiq
::
Testing
.
disable!
do
BackgroundMigrationWorker
.
perform_in
(
2
.
minutes
,
migration
,
[
1
])
BackgroundMigrationWorker
.
perform_async
(
migration
,
[
1
])
...
...
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