Skip to content

Commit

Permalink
Merge pull request #3 from stephenbm/indexes
Browse files Browse the repository at this point in the history
Add invoice_id indexes
  • Loading branch information
stephenbm committed Sep 19, 2014
2 parents b91067a + 95616d4 commit 7639a2d
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion lib/generators/active_record/templates/migration.rb
Expand Up @@ -20,13 +20,17 @@ def self.change
t.timestamps
end

add_index(:uomi_line_items, :invoice_id)

create_table "uomi_transactions", :force => true do |t|
t.integer "invoice_id"
t.string "type"
t.integer "amount"
t.timestamps
end

add_index(:uomi_transactions, :invoice_id)

create_table "uomi_invoices", :force => true do |t|
t.integer "seller_id"
t.integer "buyer_id"
Expand All @@ -46,6 +50,8 @@ def self.change
t.string "reference"
t.timestamps
end

add_index(:uomi_payment_references, :invoice_id)

create_table "uomi_sellers", :force => true do |t|
t.integer "sellerable_id"
Expand All @@ -65,6 +71,8 @@ def self.change
t.timestamps
end

add_index(:uomi_invoice_decorators, :invoice_id)

create_table "uomi_credit_note_invoices", :force => true do |t|
t.integer "invoice_id"
t.integer "credit_note_id"
Expand All @@ -81,4 +89,4 @@ def self.change

end

end
end

0 comments on commit 7639a2d

Please sign in to comment.