2017-06-13 07:44:13 -04:00
|
|
|
# rubocop:disable Migration/Timestamps
|
2016-11-13 14:35:47 -05:00
|
|
|
class CreateUserChatNamesTable < ActiveRecord::Migration
|
|
|
|
include Gitlab::Database::MigrationHelpers
|
|
|
|
|
|
|
|
DOWNTIME = false
|
|
|
|
|
|
|
|
def change
|
|
|
|
create_table :chat_names do |t|
|
2016-11-16 08:56:30 -05:00
|
|
|
t.integer :user_id, null: false
|
|
|
|
t.integer :service_id, null: false
|
|
|
|
t.string :team_id, null: false
|
|
|
|
t.string :team_domain
|
|
|
|
t.string :chat_id, null: false
|
|
|
|
t.string :chat_name
|
2016-11-16 17:10:27 -05:00
|
|
|
t.datetime :last_used_at
|
2016-11-16 08:56:30 -05:00
|
|
|
t.timestamps null: false
|
2016-11-13 14:35:47 -05:00
|
|
|
end
|
|
|
|
|
|
|
|
add_index :chat_names, [:user_id, :service_id], unique: true
|
|
|
|
add_index :chat_names, [:service_id, :team_id, :chat_id], unique: true
|
|
|
|
end
|
|
|
|
end
|