Skip to content

Commit

Permalink
adding date field for entries
Browse files Browse the repository at this point in the history
  • Loading branch information
mbulat committed Jul 24, 2015
1 parent a0b987c commit 5f08678
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 34 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ def self.up

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

Expand All @@ -23,7 +24,7 @@ def self.up
t.references :account
t.references :entry
t.decimal :amount, :precision => 20, :scale => 10
end
end
add_index :plutus_amounts, :type
add_index :plutus_amounts, [:account_id, :entry_id]
add_index :plutus_amounts, [:entry_id, :account_id]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
class TenantPlutusTables < ActiveRecord::Migration
def change
# add a tenant column to plutus accounts table.
add_column :plutus_accounts, :tenant_id, :string, index: true
add_column :plutus_accounts, :tenant_id, :integer, index: true
end
end
3 changes: 2 additions & 1 deletion fixture_rails_root/db/schema.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
#
# It's strongly recommended to check this file into your version control system.

ActiveRecord::Schema.define(:version => 20141027103120) do
ActiveRecord::Schema.define(:version => 20150722204422) do

create_table "plutus_accounts", :force => true do |t|
t.string "name"
Expand All @@ -37,6 +37,7 @@

create_table "plutus_entries", :force => true do |t|
t.string "description"
t.date "date"
t.integer "commercial_document_id"
t.string "commercial_document_type"
t.datetime "created_at"
Expand Down
1 change: 1 addition & 0 deletions lib/generators/plutus/templates/migration.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ def self.up

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

Expand Down
1 change: 1 addition & 0 deletions spec/factories/entry_factory.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
FactoryGirl.define do
factory :entry, :class => Plutus::Entry do |entry|
entry.description 'factory description'
entry.date Date.today
factory :entry_with_credit_and_debit, :class => Plutus::Entry do |entry_cd|
entry_cd.after_build do |t|
t.credit_amounts << FactoryGirl.build(:credit_amount, :entry => t)
Expand Down
31 changes: 0 additions & 31 deletions spec/schema.rb

This file was deleted.

0 comments on commit 5f08678

Please sign in to comment.