summaryrefslogtreecommitdiff
path: root/db/post_migrate/20230411153310_cleanup_bigint_conversion_for_sent_notifications.rb
blob: 567fe4fb3d2bd6f1c48b24747c035437290fbbff (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# frozen_string_literal: true

class CleanupBigintConversionForSentNotifications < Gitlab::Database::Migration[2.1]
  include Gitlab::Database::MigrationHelpers::ConvertToBigint

  enable_lock_retries!

  TABLE = :sent_notifications
  COLUMNS = [:id]

  def up
    return unless should_run?

    cleanup_conversion_of_integer_to_bigint(TABLE, COLUMNS)
  end

  def down
    return unless should_run?

    restore_conversion_of_integer_to_bigint(TABLE, COLUMNS)
  end

  def should_run?
    com_or_dev_or_test_but_not_jh?
  end
end