tab/db/migrate/20190508204811_rpush_3_1_1_updates.rb
2019-05-08 22:50:19 +02:00

15 lines
664 B
Ruby

class Rpush311Updates < ActiveRecord::VERSION::MAJOR >= 5 ? ActiveRecord::Migration[5.0] : ActiveRecord::Migration
def self.up
change_table :rpush_notifications do |t|
t.remove_index name: 'index_rpush_notifications_multi'
t.index [:delivered, :failed, :processing, :deliver_after, :created_at], name: 'index_rpush_notifications_multi', where: 'NOT delivered AND NOT failed'
end
end
def self.down
change_table :rpush_notifications do |t|
t.remove_index name: 'index_rpush_notifications_multi'
t.index [:delivered, :failed], name: 'index_rpush_notifications_multi', where: 'NOT delivered AND NOT failed'
end
end
end