chore: Add controllers for conversation participants (#6462)
Co-authored-by: Aswin Dev P.S <aswindevps@gmail.com> Co-authored-by: Sojan Jose <sojan@chatwoot.com>
This commit is contained in:
11
db/migrate/20220808193420_add_conversation_participants.rb
Normal file
11
db/migrate/20220808193420_add_conversation_participants.rb
Normal file
@@ -0,0 +1,11 @@
|
||||
class AddConversationParticipants < ActiveRecord::Migration[6.1]
|
||||
def change
|
||||
create_table 'conversation_participants', force: :cascade do |t|
|
||||
t.references :account, null: false
|
||||
t.references :user, null: false
|
||||
t.references :conversation, null: false
|
||||
t.datetime 'created_at', precision: 6, null: false
|
||||
t.datetime 'updated_at', precision: 6, null: false
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1,5 @@
|
||||
class AddUniqueIndexToConversationParticipants < ActiveRecord::Migration[6.1]
|
||||
def change
|
||||
add_index :conversation_participants, [:user_id, :conversation_id], unique: true
|
||||
end
|
||||
end
|
||||
12
db/schema.rb
12
db/schema.rb
@@ -388,6 +388,18 @@ ActiveRecord::Schema.define(version: 2023_02_09_033203) do
|
||||
t.index ["phone_number", "account_id"], name: "index_contacts_on_phone_number_and_account_id"
|
||||
end
|
||||
|
||||
create_table "conversation_participants", force: :cascade do |t|
|
||||
t.bigint "account_id", null: false
|
||||
t.bigint "user_id", null: false
|
||||
t.bigint "conversation_id", null: false
|
||||
t.datetime "created_at", precision: 6, null: false
|
||||
t.datetime "updated_at", precision: 6, null: false
|
||||
t.index ["account_id"], name: "index_conversation_participants_on_account_id"
|
||||
t.index ["conversation_id"], name: "index_conversation_participants_on_conversation_id"
|
||||
t.index ["user_id", "conversation_id"], name: "index_conversation_participants_on_user_id_and_conversation_id", unique: true
|
||||
t.index ["user_id"], name: "index_conversation_participants_on_user_id"
|
||||
end
|
||||
|
||||
create_table "conversations", id: :serial, force: :cascade do |t|
|
||||
t.integer "account_id", null: false
|
||||
t.integer "inbox_id", null: false
|
||||
|
||||
Reference in New Issue
Block a user