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/post_migrate/20220902111016_delete_null_records_from_board_group_recent_visits.rb')
-rw-r--r--db/post_migrate/20220902111016_delete_null_records_from_board_group_recent_visits.rb15
1 files changed, 15 insertions, 0 deletions
diff --git a/db/post_migrate/20220902111016_delete_null_records_from_board_group_recent_visits.rb b/db/post_migrate/20220902111016_delete_null_records_from_board_group_recent_visits.rb
new file mode 100644
index 00000000000..4b55ecc013d
--- /dev/null
+++ b/db/post_migrate/20220902111016_delete_null_records_from_board_group_recent_visits.rb
@@ -0,0 +1,15 @@
+# frozen_string_literal: true
+
+class DeleteNullRecordsFromBoardGroupRecentVisits < Gitlab::Database::Migration[2.0]
+ disable_ddl_transaction!
+
+ restrict_gitlab_migration gitlab_schema: :gitlab_main
+
+ def up
+ execute('DELETE FROM board_group_recent_visits WHERE user_id is null OR group_id is null OR board_id is null')
+ end
+
+ def down
+ # no-op
+ end
+end