summaryrefslogtreecommitdiff
path: root/db/post_migrate/20210610102413_migrate_protected_attribute_to_pending_builds.rb
diff options
context:
space:
mode:
Diffstat (limited to 'db/post_migrate/20210610102413_migrate_protected_attribute_to_pending_builds.rb')
-rw-r--r--db/post_migrate/20210610102413_migrate_protected_attribute_to_pending_builds.rb26
1 files changed, 0 insertions, 26 deletions
diff --git a/db/post_migrate/20210610102413_migrate_protected_attribute_to_pending_builds.rb b/db/post_migrate/20210610102413_migrate_protected_attribute_to_pending_builds.rb
deleted file mode 100644
index 47a6e39e87a..00000000000
--- a/db/post_migrate/20210610102413_migrate_protected_attribute_to_pending_builds.rb
+++ /dev/null
@@ -1,26 +0,0 @@
-# frozen_string_literal: true
-
-class MigrateProtectedAttributeToPendingBuilds < ActiveRecord::Migration[6.1]
- include ::Gitlab::Database::DynamicModelHelpers
-
- disable_ddl_transaction!
-
- def up
- return unless Gitlab.dev_or_test_env? || Gitlab.com?
-
- each_batch_range('ci_pending_builds', connection: connection, of: 1000) do |min, max|
- execute <<~SQL
- UPDATE ci_pending_builds
- SET protected = true
- FROM ci_builds
- WHERE ci_pending_builds.build_id = ci_builds.id
- AND ci_builds.protected = true
- AND ci_pending_builds.id BETWEEN #{min} AND #{max}
- SQL
- end
- end
-
- def down
- # no op
- end
-end