summaryrefslogtreecommitdiff
path: root/lib/gitlab/database
diff options
context:
space:
mode:
authorBob Van Landuyt <bob@gitlab.com>2017-06-21 15:27:25 +0200
committerBob Van Landuyt <bob@vanlanduyt.co>2017-06-26 17:49:30 +0200
commit66ba0b0a3444eb5063803df316be1cd14e3ef605 (patch)
treeb4281cb018e3e9b67299b289917cf3c4b5ba8f79 /lib/gitlab/database
parent589b0da7c84280fc24a3b0f1773d0de8022c291e (diff)
downloadgitlab-ce-66ba0b0a3444eb5063803df316be1cd14e3ef605.tar.gz
Clear the cache for projects one-by-one
Diffstat (limited to 'lib/gitlab/database')
-rw-r--r--lib/gitlab/database/rename_reserved_paths_migration/v1/rename_base.rb30
1 files changed, 16 insertions, 14 deletions
diff --git a/lib/gitlab/database/rename_reserved_paths_migration/v1/rename_base.rb b/lib/gitlab/database/rename_reserved_paths_migration/v1/rename_base.rb
index 68dd6f9a5b3..74f6984a6bb 100644
--- a/lib/gitlab/database/rename_reserved_paths_migration/v1/rename_base.rb
+++ b/lib/gitlab/database/rename_reserved_paths_migration/v1/rename_base.rb
@@ -102,24 +102,26 @@ module Gitlab
end
def remove_cached_html_for_projects(project_ids)
- update_column_in_batches(:projects, :description_html, nil) do |table, query|
- query.where(table[:id].in(project_ids))
- end
+ project_ids.each do |project_id|
+ update_column_in_batches(:projects, :description_html, nil) do |table, query|
+ query.where(table[:id].eq(project_id))
+ end
- update_column_in_batches(:issues, :description_html, nil) do |table, query|
- query.where(table[:project_id].in(project_ids))
- end
+ update_column_in_batches(:issues, :description_html, nil) do |table, query|
+ query.where(table[:project_id].eq(project_id))
+ end
- update_column_in_batches(:merge_requests, :description_html, nil) do |table, query|
- query.where(table[:target_project_id].in(project_ids))
- end
+ update_column_in_batches(:merge_requests, :description_html, nil) do |table, query|
+ query.where(table[:target_project_id].eq(project_id))
+ end
- update_column_in_batches(:notes, :note_html, nil) do |table, query|
- query.where(table[:project_id].in(project_ids))
- end
+ update_column_in_batches(:notes, :note_html, nil) do |table, query|
+ query.where(table[:project_id].eq(project_id))
+ end
- update_column_in_batches(:milestones, :description_html, nil) do |table, query|
- query.where(table[:project_id].in(project_ids))
+ update_column_in_batches(:milestones, :description_html, nil) do |table, query|
+ query.where(table[:project_id].eq(project_id))
+ end
end
end