Rails 迁移:如何使用 ROR 迁移增加 INTEGER 大小 [英] Rails Migration: How to increase INTEGER size by using ROR migration

查看:45
本文介绍了Rails 迁移:如何使用 ROR 迁移增加 INTEGER 大小的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的联系人表编号列是整数类型.现在我打算增加限制.

My contacts table number column is Integer type. Now I am planning to increase the limit.

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

Any one please let me know how can we increase limit by using ROR migration.

推荐答案

您可以使用 change_column 迁移方法

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

Rails 迁移指南中还提供了更多信息.

这篇关于Rails 迁移:如何使用 ROR 迁移增加 INTEGER 大小的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆