Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'db/migrate/20220825134827_remove_not_null_constraint_for_confidence_columns.rb')
-rw-r--r--db/migrate/20220825134827_remove_not_null_constraint_for_confidence_columns.rb15
1 files changed, 15 insertions, 0 deletions
diff --git a/db/migrate/20220825134827_remove_not_null_constraint_for_confidence_columns.rb b/db/migrate/20220825134827_remove_not_null_constraint_for_confidence_columns.rb
new file mode 100644
index 00000000000..e41d93ebf8b
--- /dev/null
+++ b/db/migrate/20220825134827_remove_not_null_constraint_for_confidence_columns.rb
@@ -0,0 +1,15 @@
+# frozen_string_literal: true
+
+class RemoveNotNullConstraintForConfidenceColumns < Gitlab::Database::Migration[2.0]
+ disable_ddl_transaction!
+
+ def up
+ change_column_null :vulnerabilities, :confidence, true
+ change_column_null :vulnerability_occurrences, :confidence, true
+ change_column_null :security_findings, :confidence, true
+ end
+
+ def down
+ # no-op: We can not set `NOT NULL` constraint here as there can be NULL values already.
+ end
+end