Rails 小数精度和小数位数
我在 Rails 应用程序中有大约 30 个表,并且我想更改大约 6 个表的一些小数列的精度和小数位数。您如何对现有的列进行此操作?您是否需要单独进行每个新的迁移,还是可以一次性完成所有迁移。
I have about 30 tables in a rails app and there are about 6 tables for which I would like to change the precision and scale of some of the decimal columns. How do you go about doing that for already existing columns? Do you need to do each new migration separately, or can they all be done at once.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
will update the column's type.
参考: http://apidock.com/rails/ActiveRecord/ConnectionAdapters/SchemaStatements/change_column< /a>
will update the column's type.
Ref: http://apidock.com/rails/ActiveRecord/ConnectionAdapters/SchemaStatements/change_column