Sha256: 6f60d319b6015f5d1e381de66c05e8fd39a1f483e3f8fdb35dfba37cf8dd8ffc

Contents?: true

Size: 388 Bytes

Versions: 3

Compression:

Stored size: 388 Bytes

Contents

class ChangeBorutusAmountCountColumn < ActiveRecord::Migration[4.2]

  def up
    remove_column :borutus_accounts, :borutus_amounts_count
    add_column :borutus_accounts, :amounts_count, :integer

    Borutus::Account.all.pluck(:id).each do |id|
      Borutus::Account.reset_counters(id, :amounts)
    end
  end

  def down
    remove_column :borutus_accounts, :amounts_count
  end

end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
borutus-1.0.0 db/migrate/20191025154652_change_borutus_amount_count_column.rb
borutus-0.2.4 db/migrate/20191025154652_change_borutus_amount_count_column.rb
borutus-0.2.3 db/migrate/20191025154652_change_borutus_amount_count_column.rb