discourse/plugins/chat/db/migrate/20210812145801_create_direct_message_tables.rb
Roman Rizzi 0a5f548635
DEV: Move discourse-chat to the core repo. (#18776)
As part of this move, we are also renaming `discourse-chat` to `chat`.
2022-11-02 10:41:30 -03:00

21 lines
529 B
Ruby

# frozen_string_literal: true
class CreateDirectMessageTables < ActiveRecord::Migration[6.1]
def change
create_table :direct_message_channels do |t|
t.timestamps
end
create_table :direct_message_users do |t|
t.integer :direct_message_channel_id, null: false
t.integer :user_id, null: false
t.timestamps
end
add_index :direct_message_users,
%i[direct_message_channel_id user_id],
unique: true,
name: "direct_message_users_index"
end
end