From 8b210df3bdc0b61894fae95e9ff60a6a841ef0e1 Mon Sep 17 00:00:00 2001 From: GitLab Bot Date: Wed, 4 Nov 2020 06:09:13 +0000 Subject: Add latest changes from gitlab-org/gitlab@master --- ...20201102152945_truncate_security_findings_table.rb | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 db/post_migrate/20201102152945_truncate_security_findings_table.rb (limited to 'db/post_migrate/20201102152945_truncate_security_findings_table.rb') diff --git a/db/post_migrate/20201102152945_truncate_security_findings_table.rb b/db/post_migrate/20201102152945_truncate_security_findings_table.rb new file mode 100644 index 00000000000..8bfaa31f0de --- /dev/null +++ b/db/post_migrate/20201102152945_truncate_security_findings_table.rb @@ -0,0 +1,19 @@ +# frozen_string_literal: true + +class TruncateSecurityFindingsTable < ActiveRecord::Migration[6.0] + include Gitlab::Database::MigrationHelpers + + DOWNTIME = false + + def up + return unless Gitlab.dev_env_or_com? + + with_lock_retries do + connection.execute('TRUNCATE security_findings RESTART IDENTITY') + end + end + + def down + # no-op + end +end -- cgit v1.2.3