20170314082049_create_system_note_metadata.rb 526 Bytes
Newer Older
1
# rubocop:disable Migration/Timestamps
2
class CreateSystemNoteMetadata < ActiveRecord::Migration[4.2]
3 4 5 6 7 8
  include Gitlab::Database::MigrationHelpers

  DOWNTIME = false

  disable_ddl_transaction!

9
  def up
10 11 12
    create_table :system_note_metadata do |t|
      t.references :note, null: false
      t.integer :commit_count
13
      t.string :action
14 15 16 17

      t.timestamps null: false
    end

18 19 20 21 22
    add_concurrent_foreign_key :system_note_metadata, :notes, column: :note_id
  end

  def down
    drop_table :system_note_metadata
23 24
  end
end