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

20170314082049_create_system_note_metadata.rb « migrate « db - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: fee47e9605327a79a50d9347668f40fa35381788 (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
# rubocop:disable Migration/Timestamps
class CreateSystemNoteMetadata < ActiveRecord::Migration
  include Gitlab::Database::MigrationHelpers

  DOWNTIME = false

  disable_ddl_transaction!

  def up
    create_table :system_note_metadata do |t|
      t.references :note, null: false
      t.integer :commit_count
      t.string :action

      t.timestamps null: false
    end

    add_concurrent_foreign_key :system_note_metadata, :notes, column: :note_id
  end

  def down
    drop_table :system_note_metadata
  end
end