Reputation: 18064
I'm not able to generate string fields with a specified length in a migration. They are always created with 255 character-length.
Anyone knows?
Upvotes: 6
Views: 8433
Reputation: 46675
I think you're looking for the :limit option:
:limit
class CreateUser < ActiveRecord::Migration def change create_table :users do |t| t.string :name, :limit => 10 end end end
Reference
Upvotes: 14