summaryrefslogtreecommitdiff
path: root/db/migrate/20210429131525_create_user_credit_card_validations.rb
blob: 8548274b29aa092a99ac6728839905adcad43431 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# frozen_string_literal: true

class CreateUserCreditCardValidations < ActiveRecord::Migration[6.0]
  include Gitlab::Database::MigrationHelpers

  disable_ddl_transaction!

  def up
    with_lock_retries do
      create_table :user_credit_card_validations, id: false do |t|
        t.references :user, foreign_key: { on_delete: :cascade }, index: false, primary_key: true, default: nil
        t.datetime_with_timezone :credit_card_validated_at, null: false
      end
    end
  end

  def down
    with_lock_retries do
      drop_table :user_credit_card_validations
    end
  end
end