Skip to content

A platform for community discussion. Free, open, simple.

DEV: Remove NULLS NOT DISTINCT from problem check trackers (#29327)

Ted Johansson63ed1b5bd79a
diff --git a/db/migrate/20241022022326_remove_nulls_not_distinct_from_problem_check_trackers.rb b/db/migrate/20241022022326_remove_nulls_not_distinct_from_problem_check_trackers.rb
new file mode 100644
index 00000000000..1e2317012a9
--- /dev/null
+++ b/db/migrate/20241022022326_remove_nulls_not_distinct_from_problem_check_trackers.rb
@@ -0,0 +1,12 @@
+# frozen_string_literal: true
+class RemoveNullsNotDistinctFromProblemCheckTrackers < ActiveRecord::Migration[7.1]
+ def up
+ remove_index :problem_check_trackers, %i[identifier target], if_exists: true
+ add_index :problem_check_trackers, %i[identifier target], unique: true
+ end
+
+ def down
+ remove_index :problem_check_trackers, %i[identifier target], if_exists: true
+ add_index :problem_check_trackers, %i[identifier target], unique: true, nulls_not_distinct: true
+ end
+end