2016-05-17 9 views
0

hallo.Syntax für Schienen g Migration mit Space

Ich versuche, eine Spalte namens product_size zu meiner order_items Tabelle in meinem Schema hinzuzufügen.

mache ich das von:

$ rails g migration add_product_size_to_order_items

oder

$ rails g migration add_product_size_to_OrderItem

oder sonst?

Danke!

Antwort

1

sollten Sie

rails g migration add_product_size_to_order_items 

dann fügen Sie verwenden auch diese Zeile product_size:data_type

Beispiel:

rails g migration add_product_size_to_order_items product_size:decimal 
+0

Dank! :) Es hat funktioniert: '' '$ rails g migration add_product_size_to_order_items product_size: string''' –