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?
I think you're looking for the :limit
option:
class CreateUser < ActiveRecord::Migration
def change
create_table :users do |t|
t.string :name, :limit => 10
end
end
end
Reference
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With