Chatwoot/db/migrate/20220506163839_add_additional_attributes_to_message.rb
Aswin Dev P.S 360b438a55
Fix: Campaign triggers first_response reporting event (#4607)
* Fix: Campaign triggers first_response reporting event

* fix spec failure
2022-05-09 01:34:52 -07:00

14 lines
583 B
Ruby

class AddAdditionalAttributesToMessage < ActiveRecord::Migration[6.1]
disable_ddl_transaction!
def up
add_column :messages, :additional_attributes, :jsonb, default: {}
add_index :messages, "((additional_attributes->'campaign_id'))", name: 'index_messages_on_additional_attributes_campaign_id', using: 'gin',
algorithm: :concurrently
end
def down
remove_index :messages, name: 'index_messages_on_additional_attributes_campaign_id'
remove_column :messages, :additional_attributes
end
end