BigW Consortium Gitlab

20170314082049_create_system_note_metadata.rb 482 Bytes
Newer Older
1 2 3 4 5 6 7
class CreateSystemNoteMetadata < ActiveRecord::Migration
  include Gitlab::Database::MigrationHelpers

  DOWNTIME = false

  disable_ddl_transaction!

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

      t.timestamps null: false
    end

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

  def down
    drop_table :system_note_metadata
22 23
  end
end