2017-02-02 14:04:02 +00:00
|
|
|
class CreateChatTeams < ActiveRecord::Migration
|
|
|
|
include Gitlab::Database::MigrationHelpers
|
|
|
|
|
2017-02-24 12:25:42 +00:00
|
|
|
DOWNTIME = true
|
|
|
|
DOWNTIME_REASON = "Adding a foreign key"
|
2017-02-02 14:04:02 +00:00
|
|
|
|
|
|
|
def change
|
|
|
|
create_table :chat_teams do |t|
|
2017-02-20 13:50:32 +00:00
|
|
|
t.integer :namespace_id, index: true
|
2017-02-02 14:04:02 +00:00
|
|
|
t.string :team_id
|
|
|
|
t.string :name
|
|
|
|
|
|
|
|
t.timestamps null: false
|
|
|
|
end
|
|
|
|
|
2017-02-24 12:25:42 +00:00
|
|
|
add_concurrent_foreign_key :chat_teams, :namespaces, on_delete: :cascade
|
2017-02-02 14:04:02 +00:00
|
|
|
end
|
|
|
|
end
|