简体   繁体   English

使用Space迁移Rails G的语法

[英]Syntax for rails g migration with Space

hello. 你好。

I'm trying to add a column called product_size to my order_items table in my schema. 我试图在我的架构中的我的order_items表中添加一个名为product_size的列。

Do I do this by: 我要这样做吗?

$ rails g migration add_product_size_to_order_items

or 要么

$ rails g migration add_product_size_to_OrderItem

or otherwise? 还是其他?

Thanks! 谢谢!

You should use 你应该用

rails g migration add_product_size_to_order_items

then add also this line product_size:data_type 然后还添加以下行product_size:data_type

sample: 样品:

rails g migration add_product_size_to_order_items product_size:decimal

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM