summaryrefslogtreecommitdiff
path: root/db
diff options
context:
space:
mode:
authorFelipe Artur <felipefac@gmail.com>2019-02-12 14:40:37 -0200
committerFelipe Artur <felipefac@gmail.com>2019-02-12 14:40:37 -0200
commit362d56e65a0e23fcf4fd5bd4535d258c3659ffd5 (patch)
tree2b3082775f496d79e7657d4fa92363fc3bebbe91 /db
parente9b84f50e961ee7c3abfb8192de8f4fc778df041 (diff)
downloadgitlab-ce-362d56e65a0e23fcf4fd5bd4535d258c3659ffd5.tar.gz
Schedule background migrations and specs
Diffstat (limited to 'db')
-rw-r--r--db/migrate/20190211131150_add_state_id_to_issuables.rb10
1 files changed, 8 insertions, 2 deletions
diff --git a/db/migrate/20190211131150_add_state_id_to_issuables.rb b/db/migrate/20190211131150_add_state_id_to_issuables.rb
index af02aa84afd..b9d52fe63cd 100644
--- a/db/migrate/20190211131150_add_state_id_to_issuables.rb
+++ b/db/migrate/20190211131150_add_state_id_to_issuables.rb
@@ -1,5 +1,6 @@
class AddStateIdToIssuables < ActiveRecord::Migration[5.0]
include Gitlab::Database::MigrationHelpers
+ #include AfterCommitQueue
DOWNTIME = false
MIGRATION = 'SyncIssuablesStateId'.freeze
@@ -26,8 +27,13 @@ class AddStateIdToIssuables < ActiveRecord::Migration[5.0]
add_column :issues, :state_id, :integer, limit: 1
add_column :merge_requests, :state_id, :integer, limit: 1
- queue_background_migration_jobs_by_range_at_intervals(Issue.where(state_id: nil), MIGRATION, DELAY_INTERVAL, batch_size: BATCH_SIZE)
- queue_background_migration_jobs_by_range_at_intervals(MergeRequest.where(state_id: nil), MIGRATION, DELAY_INTERVAL, batch_size: BATCH_SIZE)
+ # Is this safe?
+ # Added to avoid an warning about jobs running inside transactions.
+ # Since we only add a column this should be ok
+ Sidekiq::Worker.skipping_transaction_check do
+ queue_background_migration_jobs_by_range_at_intervals(Issue.where(state_id: nil), MIGRATION, DELAY_INTERVAL, batch_size: BATCH_SIZE)
+ queue_background_migration_jobs_by_range_at_intervals(MergeRequest.where(state_id: nil), MIGRATION, DELAY_INTERVAL, batch_size: BATCH_SIZE)
+ end
end
def down