【问题标题】:Rails Migration: How to increase INTEGER size by using ROR migrationRails 迁移:如何使用 ROR 迁移增加 INTEGER 大小
【发布时间】:2015-08-14 15:30:02
【问题描述】:

我的联系人表编号列是整数类型。现在我打算提高限额。

请告诉我如何通过使用 ROR 迁移来增加限制。

【问题讨论】:

  • 8401905643 超出 ActiveRecord::Type::Integer 的范围,限制为 4 change_colmn 不起作用

标签: ruby-on-rails ruby-on-rails-4


【解决方案1】:

你可以使用change_columnmigration方法

change_column :table_name, :table_column, :integer, limit: N

更多信息也可通过Rails migration guide 获得。

【讨论】:

    猜你喜欢
    • 2015-02-06
    • 1970-01-01
    • 1970-01-01
    • 2010-10-16
    • 1970-01-01
    • 1970-01-01
    • 2015-01-27
    • 2012-03-07
    • 1970-01-01
    相关资源
    最近更新 更多