BigW Consortium Gitlab

20170120131253_create_chat_teams.rb 473 Bytes
Newer Older
1
# rubocop:disable Migration/Timestamps
2 3 4
class CreateChatTeams < ActiveRecord::Migration
  include Gitlab::Database::MigrationHelpers

Z.J. van de Weg committed
5 6
  DOWNTIME = true
  DOWNTIME_REASON = "Adding a foreign key"
7

Z.J. van de Weg committed
8 9
  disable_ddl_transaction!

10 11
  def change
    create_table :chat_teams do |t|
12
      t.references :namespace, null: false, index: { unique: true }, foreign_key: { on_delete: :cascade }
13 14 15 16 17 18 19
      t.string :team_id
      t.string :name

      t.timestamps null: false
    end
  end
end