Sha256: c14a51831762f202611163aa3ec42c014d9bd8472a181ee43963a82f6faa0e54

Contents?: true

Size: 852 Bytes

Versions: 2

Compression:

Stored size: 852 Bytes

Contents

class UpdateCredereTables < ActiveRecord::Migration[5.2]
  def change
    # we have to remove these indexes because the temporary
    # table index name is too long
    remove_index :credere_amounts, [:account_id, :transaction_id]
    remove_index :credere_amounts, [:transaction_id, :account_id]
    remove_index :credere_transactions, column: [:commercial_document_id, :commercial_document_type], :name => "index_transactions_on_commercial_doc"

    rename_table :credere_transactions, :credere_entries
    rename_column :credere_amounts, :transaction_id, :entry_id

    # adding the indexes back
    add_index :credere_amounts, [:account_id, :entry_id]
    add_index :credere_amounts, [:entry_id, :account_id]
    add_index :credere_entries, [:commercial_document_id, :commercial_document_type], :name => "index_entries_on_commercial_doc"
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
credere-0.10.3 lib/generators/credere/templates/update_migration.rb
credere-0.10.2 lib/generators/credere/templates/update_migration.rb