Sha256: 278107f5f8c4a56c2ed047826a19ea8bc7cd898a91cd4d82e6c29563059b05b8

Contents?: true

Size: 842 Bytes

Versions: 2

Compression:

Stored size: 842 Bytes

Contents

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

    rename_table :plutus_transactions, :plutus_entries
    rename_column :plutus_amounts, :transaction_id, :entry_id

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

Version data entries

2 entries across 2 versions & 2 rubygems

Version Path
odania_plutus-0.13 lib/generators/plutus/templates/update_migration.rb
plutus-0.13 lib/generators/plutus/templates/update_migration.rb