15 lines
583 B
Ruby
15 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
|