Sha256: 182f15a8eaa3fbdb7492ea854012142ad30e60f6c48777690d9f081c38b746e9

Contents?: true

Size: 978 Bytes

Versions: 7

Compression:

Stored size: 978 Bytes

Contents

class CreateBorutusTables < ActiveRecord::Migration[4.2]
  def change
    create_table :borutus_accounts do |t|
      t.string :name
      t.string :type
      t.boolean :contra, default: false

      t.timestamps
    end
    add_index :borutus_accounts, [:name, :type]

    create_table :borutus_entries do |t|
      t.string :description
      t.date :date
      t.integer :commercial_document_id
      t.string :commercial_document_type

      t.timestamps
    end
    add_index :borutus_entries, :date
    add_index :borutus_entries, [:commercial_document_id, :commercial_document_type], :name => "index_entries_on_commercial_doc"

    create_table :borutus_amounts do |t|
      t.string :type
      t.references :account
      t.references :entry
      t.decimal :amount, :precision => 20, :scale => 10
    end
    add_index :borutus_amounts, :type
    add_index :borutus_amounts, [:account_id, :entry_id]
    add_index :borutus_amounts, [:entry_id, :account_id]
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
borutus-1.0.0 db/migrate/20160422010135_create_borutus_tables.rb
borutus-0.2.4 db/migrate/20160422010135_create_borutus_tables.rb
borutus-0.2.3 db/migrate/20160422010135_create_borutus_tables.rb
borutus-0.2.2 db/migrate/20160422010135_create_borutus_tables.rb
borutus-0.2.1 db/migrate/20160422010135_create_borutus_tables.rb
borutus-0.2.0 db/migrate/20160422010135_create_borutus_tables.rb
borutus-0.1.0 db/migrate/20160422010135_create_borutus_tables.rb