foodsoft/db/migrate/20160222000000_create_bank_accounts_and_transactions.rb

26 lines
754 B
Ruby
Raw Permalink Normal View History

class CreateBankAccountsAndTransactions < ActiveRecord::Migration[4.2]
2018-09-14 19:33:27 +02:00
def change
create_table :bank_accounts do |t|
t.string :name, null: false
t.string :iban
t.string :description
t.decimal :balance, precision: 12, scale: 2, default: 0, null: false
t.datetime :last_import
t.string :import_continuation_point
end
create_table :bank_transactions do |t|
t.references :bank_account, null: false
t.string :external_id
t.date :date
t.decimal :amount, precision: 8, scale: 2, null: false
t.string :iban
t.string :reference
t.text :text
t.text :receipt
t.binary :image, limit: 1.megabyte
t.references :financial_link, index: true
end
end
end