Rails Migration Coumn Types

 Migrations support all the basic data types − The following is the list of data types that migration supports −

  • string − for small data types such as a title.

  • text − for longer pieces of textual data, such as the description.

  • integer − for whole numbers.

  • float − for decimals.

  • datetime and timestamp − store the date and time into a column.

  • date and time − store either the date only or time only.

  • binary − for storing data such as images, audio, or movies.

  • Boolean − for storing true or false values.

Valid column options are − The following is the list of valid column options.

  • limit ( :limit => “50” )

  • default (:default => “blah” )

  • null (:null => false implies NOT NULL)

Comments

Popular posts from this blog

Rails 7 Features :: Comparison with Rails 6 and Rails 5