Introduced StockChange. Implemented first part of stockit-logic with updating article's quantity.
This commit is contained in:
parent
7ff0467b16
commit
b38025869a
27 changed files with 233 additions and 123 deletions
17
db/migrate/20090115232435_create_stock_changes.rb
Normal file
17
db/migrate/20090115232435_create_stock_changes.rb
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
class CreateStockChanges < ActiveRecord::Migration
|
||||
def self.up
|
||||
create_table :stock_changes do |t|
|
||||
t.references :delivery
|
||||
t.references :order
|
||||
t.references :article
|
||||
t.decimal :quantity, :precision => 6, :scale => 2, :default => 0.0
|
||||
t.datetime :created_at
|
||||
end
|
||||
|
||||
add_column :articles, :quantity, :decimal, :precision => 6, :scale => 2, :default => 0.0
|
||||
end
|
||||
|
||||
def self.down
|
||||
drop_table :stock_changes
|
||||
end
|
||||
end
|
||||
Loading…
Add table
Add a link
Reference in a new issue