summaryrefslogtreecommitdiff
path: root/db/post_migrate/20230321163547_cleanup_conversion_big_int_ci_build_needs.rb
diff options
context:
space:
mode:
Diffstat (limited to 'db/post_migrate/20230321163547_cleanup_conversion_big_int_ci_build_needs.rb')
-rw-r--r--db/post_migrate/20230321163547_cleanup_conversion_big_int_ci_build_needs.rb10
1 files changed, 10 insertions, 0 deletions
diff --git a/db/post_migrate/20230321163547_cleanup_conversion_big_int_ci_build_needs.rb b/db/post_migrate/20230321163547_cleanup_conversion_big_int_ci_build_needs.rb
index 4812cb2deca..680a496e639 100644
--- a/db/post_migrate/20230321163547_cleanup_conversion_big_int_ci_build_needs.rb
+++ b/db/post_migrate/20230321163547_cleanup_conversion_big_int_ci_build_needs.rb
@@ -1,15 +1,25 @@
# frozen_string_literal: true
class CleanupConversionBigIntCiBuildNeeds < Gitlab::Database::Migration[2.1]
+ include Gitlab::Database::MigrationHelpers::ConvertToBigint
+
enable_lock_retries!
TABLE = :ci_build_needs
def up
+ return unless should_run?
+
cleanup_conversion_of_integer_to_bigint(TABLE, :id)
end
def down
+ return unless should_run?
+
restore_conversion_of_integer_to_bigint(TABLE, :id)
end
+
+ def should_run?
+ com_or_dev_or_test_but_not_jh?
+ end
end