Use batch update for Service deactivation
This commit is contained in:
parent
8bc3221f2f
commit
2d3c7d29b2
1 changed files with 5 additions and 4 deletions
|
@ -140,10 +140,11 @@ class MigrateKubernetesServiceToNewClustersArchitectures < ActiveRecord::Migrati
|
|||
Gitlab::Database.bulk_insert('cluster_projects', rows_for_cluster_projects)
|
||||
end
|
||||
|
||||
connection.execute <<~SQL
|
||||
UPDATE services SET active = false
|
||||
WHERE category = 'deployment' AND type = 'KubernetesService' AND template = false
|
||||
SQL
|
||||
MigrateKubernetesServiceToNewClustersArchitectures::Service
|
||||
.where(category: 'deployment', type: 'KubernetesService', template: false)
|
||||
.each_batch(of: 100) do |batch|
|
||||
batch.update_all(active: false)
|
||||
end
|
||||
end
|
||||
|
||||
def down
|
||||
|
|
Loading…
Reference in a new issue