Welcome to mirror list, hosted at ThFree Co, Russian Federation.

20210602122213_add_upcoming_reconciliations.rb « migrate « db - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 90d0013b357c3c0b772cb871c2048e7014fa8ac4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# frozen_string_literal: true

class AddUpcomingReconciliations < ActiveRecord::Migration[6.1]
  include Gitlab::Database::MigrationHelpers

  def up
    with_lock_retries do
      create_table :upcoming_reconciliations do |t|
        t.references :namespace, index: { unique: true }, null: true, foreign_key: { on_delete: :cascade }
        t.date :next_reconciliation_date, null: false
        t.date :display_alert_from, null: false

        t.timestamps_with_timezone
      end
    end
  end

  def down
    with_lock_retries do
      drop_table :upcoming_reconciliations
    end
  end
end