summaryrefslogtreecommitdiff
path: root/db/migrate/20200416005331_create_status_page_published_incidents.rb
blob: ea2ddcde9255fcd7290a66a186fe4da0b8b5f9a5 (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 CreateStatusPagePublishedIncidents < ActiveRecord::Migration[6.0]
  include Gitlab::Database::MigrationHelpers

  DOWNTIME = false

  def up
    with_lock_retries do
      create_table :status_page_published_incidents do |t|
        t.timestamps_with_timezone null: false
        t.references :issue, null: false, index: { unique: true }, foreign_key: { on_delete: :cascade }
      end
    end
  end

  def down
    # rubocop:disable Migration/DropTable
    drop_table :status_page_published_incidents
    # rubocop:enable Migration/DropTable
  end
end