SitePoint Sponsor

User Tag List

Results 1 to 2 of 2

Thread: Data Types

  1. #1
    SitePoint Member
    Join Date
    Feb 2009
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question Data Types

    Does anyone have a link for a reference on data types in rails to their corresponding data type in the respective db? Ex. t.string = mysql varchar, t.integer = mysql integer.

    Thanks for helping

  2. #2
    SitePoint Member
    Join Date
    Feb 2009
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I answered my own question. Just in case anyone else needs this info I found this in the Rails Framework Documentation under class ActiveRecord::Migration

    specified to be one of the following types:
    :string,
    :text,
    :integer,
    :float,
    :decimal,
    :datetime,
    :timestamp,
    :time,
    :date,
    :binary,
    :boolean.

    A default value can be specified by passing an options hash like { :default => 11 }. Other options include :limit and :null (e.g. { :limit => 50, :null => false }) — see ActiveRecord::ConnectionAdapters::TableDefinition#column for details.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •