diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-11-04 09:09:13 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-11-04 09:09:13 +0300 |
commit | 8b210df3bdc0b61894fae95e9ff60a6a841ef0e1 (patch) | |
tree | dc89e8ad72519316781c9b2c355f46ca63c2e6c0 /db | |
parent | 09fe75d83726876b62f778ce7ef7a31752915d35 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'db')
-rw-r--r-- | db/post_migrate/20201102152945_truncate_security_findings_table.rb | 19 | ||||
-rw-r--r-- | db/schema_migrations/20201102152945 | 1 |
2 files changed, 20 insertions, 0 deletions
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 diff --git a/db/schema_migrations/20201102152945 b/db/schema_migrations/20201102152945 new file mode 100644 index 00000000000..cb4ae9c2598 --- /dev/null +++ b/db/schema_migrations/20201102152945 @@ -0,0 +1 @@ +55ffd18d5f55ee0fd51a31d50cf2d51595740c72ca23d5134d93e2da3fc186ff
\ No newline at end of file |