discourse/plugins/chat/db/migrate/20210812145801_create_direc...

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

21 lines
529 B
Ruby
Raw Normal View History

# 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