Contact model changes (#184)

* move source id from contacts

* Fix contactInbox model name

* rubocop fix

* Fix rspec
This commit is contained in:
Sojan Jose
2019-10-27 13:14:36 +05:30
committed by GitHub
parent 3b6d58bbdf
commit c21c839dca
12 changed files with 57 additions and 20 deletions

View File

@@ -0,0 +1,15 @@
class CreateContactInboxes < ActiveRecord::Migration[6.1]
def change
create_table :contact_inboxes do |t|
t.references :contact, foreign_key: true, index: true
t.references :inbox, foreign_key: true, index: true
t.string :source_id, null: false
t.timestamps
end
add_index :contact_inboxes, [:inbox_id, :source_id], :unique => true
add_index :contact_inboxes, [:source_id]
remove_column :contacts, :inbox_id, :integer
remove_column :contacts, :source_id, :integer
end
end