@@ -56,6 +54,25 @@ class PatchPrometheusServicesForSharedClusterApplications < ActiveRecord::Migrat
AND clusters_applications_prometheus.status IN (#{Applications::Prometheus.statuses[:installed]}, #{Applications::Prometheus.statuses[:updated]})").exists?
IN (#{Migratable::Applications::Prometheus.statuses[:installed]}, #{Migratable::Applications::Prometheus.statuses[:updated]}))")
end
defclear_duplicates
subquery=Migratable::PrometheusService.managed.not_template.select("id, ROW_NUMBER() OVER(PARTITION BY project_id ORDER BY project_id) AS row_num").to_sql
duplicates_filter="id in (SELECT id FROM (#{subquery}) t WHERE t.row_num > 1)"