Skip to content

Commit

Permalink
line_items マイグレーション修正
Browse files Browse the repository at this point in the history
外部キー制約ほか
  • Loading branch information
kyanny committed Jan 22, 2010
1 parent 5a277c5 commit 1984930
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions depot/db/migrate/20100122061534_create_line_items.rb
@@ -1,10 +1,10 @@
class CreateLineItems < ActiveRecord::Migration
def self.up
create_table :line_items do |t|
t.integer :product_id
t.integer :order_id
t.integer :quantity
t.decimal :total_price
t.integer :product_id, :null => false, :options => "CONSTRAINT fk_line_item_products REFERENCES products(id)"
t.integer :order_id, :null => false, :options => "CONSTRAINT fk_line_item_orders REFERENCES orders(id)"
t.integer :quantity, :null => false
t.decimal :total_price, :null => false, :precision => 8, :scale => 2

t.timestamps
end
Expand Down

0 comments on commit 1984930

Please sign in to comment.