I cannot generate string fields with the specified length in the migration. They are always created with a length of 255 characters.
Somebody knows?
I think you are looking for the option :limit :
:limit
class CreateUser < ActiveRecord::Migration def change create_table :users do |t| t.string :name, :limit => 10 end end end
Link
Source: https://habr.com/ru/post/1386272/More articles:Yii Custom Footer CGridView - yiiDelete on already deleted object: behavior? - c ++The top letter of the first line of lines in IE7 - javascriptWhat can cause multiple determination errors after declaring an inline function? - cMysterious NullPointerException throws when working with Spinner - androidHow to adjust width according to space available for wpf toolbartray - c #Why doesn't whitespaceAndNewlineCharacterSet remove spaces? - iphoneHow to insert 12 consecutive digits into 4 text fields using the TextChanged property? - c #Python module to remove internet jargon / slang / acronym - pythonHow can I use Node.js for Frontend and Wordpress as a Backend? - jsonAll Articles