summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--db/post_migrate/20171124104327_migrate_kubernetes_service_to_new_clusters_architectures.rb9
1 files changed, 5 insertions, 4 deletions
diff --git a/db/post_migrate/20171124104327_migrate_kubernetes_service_to_new_clusters_architectures.rb b/db/post_migrate/20171124104327_migrate_kubernetes_service_to_new_clusters_architectures.rb
index aff934c2ab4..2808c8e0222 100644
--- a/db/post_migrate/20171124104327_migrate_kubernetes_service_to_new_clusters_architectures.rb
+++ b/db/post_migrate/20171124104327_migrate_kubernetes_service_to_new_clusters_architectures.rb
@@ -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