mirror of
https://github.com/lingble/chatwoot.git
synced 2025-11-02 03:57:52 +00:00
Change sender_id to contact_id in conversations (#167)
* change sender_id to contact_id in conversations * Fix failing tests * Fix seeds * fix specs * Fix issues in facebook messenger
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
class RenameSenderIdToContactInConversation < ActiveRecord::Migration[6.1]
|
||||
def change
|
||||
rename_column :conversations, :sender_id, :contact_id
|
||||
end
|
||||
end
|
||||
@@ -10,7 +10,7 @@
|
||||
#
|
||||
# It's strongly recommended that you check this file into your version control system.
|
||||
|
||||
ActiveRecord::Schema.define(version: 2019_10_20_085608) do
|
||||
ActiveRecord::Schema.define(version: 2019_10_20_173522) do
|
||||
|
||||
# These are extensions that must be enabled in order to support this database
|
||||
enable_extension "plpgsql"
|
||||
@@ -85,7 +85,7 @@ ActiveRecord::Schema.define(version: 2019_10_20_085608) do
|
||||
t.integer "assignee_id"
|
||||
t.datetime "created_at", null: false
|
||||
t.datetime "updated_at", null: false
|
||||
t.bigint "sender_id"
|
||||
t.bigint "contact_id"
|
||||
t.integer "display_id", null: false
|
||||
t.datetime "user_last_seen_at"
|
||||
t.datetime "agent_last_seen_at"
|
||||
|
||||
@@ -10,5 +10,5 @@ inbox = Inbox.create!(channel: web_widget, account: account, name: 'Acme Support
|
||||
InboxMember.create!(user: user, inbox: inbox)
|
||||
|
||||
contact = Contact.create!(name: 'jane', email: 'jane@example.com', phone_number: '0000', inbox: inbox, account: account)
|
||||
Conversation.create!(account: account, inbox: inbox, status: :open, assignee_id: 1, sender: contact)
|
||||
Message.create!(content: 'Hello', account_id: 1, inbox_id: 1, conversation_id: 1, message_type: :incoming)
|
||||
conversation = Conversation.create!(account: account, inbox: inbox, status: :open, assignee: user, contact: contact)
|
||||
Message.create!(content: 'Hello', account: account, inbox: inbox, conversation: conversation, message_type: :incoming)
|
||||
Reference in New Issue
Block a user