debian-mirror-gitlab/db/migrate/20161113184239_create_user_chat_names_table.rb

23 lines
644 B
Ruby
Raw Normal View History

2017-09-10 17:25:29 +05:30
# rubocop:disable Migration/Timestamps
2018-12-23 12:14:25 +05:30
class CreateUserChatNamesTable < ActiveRecord::Migration[4.2]
2017-08-17 22:00:37 +05:30
include Gitlab::Database::MigrationHelpers
DOWNTIME = false
def change
create_table :chat_names do |t|
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
t.datetime :last_used_at
t.timestamps null: false
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