Sra*_*mar 44 ruby migration ruby-on-rails
我的用户表登录列是String类型,限制为40个字符.现在我计划将限制增加到55个字符.
任何人请告诉我如何通过使用ROR迁移来增加此限制.
谢谢,Sravan
bee*_*soh 58
class YourMigration < ActiveRecord::Migration
def up
change_column :users, :login, :string, :limit => 55
end
def down
change_column :users, :login, :string, :limit => 40
end
end
Run Code Online (Sandbox Code Playgroud)
tir*_*adc 21
class YourMigration < ActiveRecord::Migration
def change
change_column :users, :login, :string, :limit => 55
end
end
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
23263 次 |
| 最近记录: |