gitlab-org--gitlab-foss/db/migrate/20161113184239_create_user_chat_names_table.rb

24 lines
676 B
Ruby
Raw Normal View History

# rubocop:disable Migration/Datetime
# rubocop:disable Migration/Timestamps
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
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