Data Types for DB, MySQL, SQLite, PHP, Ruby, Rails, JS, etc. because I forget them sometimes


/ Published in: Other
Save to your folder(s)

Data Types for DB, MySQL, SQLite, PHP, Ruby, Rails, JS, etc. because I forget them sometimes


from Ruby on Rails Guides: Migrations http://bit.ly/hFWjT0

from Rails Migrations http://bit.ly/hI5zpz


Copy this code and paste it in your HTML
  1. Data Types for DB, MySQL, SQLite, PHP, Ruby, Rails, JS, etc.
  2.  
  3. ====
  4.  
  5. from Ruby on Rails Guides: Migrations http://bit.ly/hFWjT0
  6.  
  7. The types supported by Active Record are :primary_key, :string, :text, :integer, :float, :decimal, :datetime, :timestamp, :time, :date, :binary, :boolean.
  8.  
  9. ====
  10.  
  11. from Rails Migrations http://bit.ly/hI5zpz
  12.  
  13. Migrations support all the basic data types: string, text, integer, float, datetime, timestamp, time, date, binary and boolean:
  14.  
  15. string - is for small data types such as a title.
  16.  
  17. text - is for longer pieces of textual data, such as the description.
  18.  
  19. integer - is for whole numbers.
  20.  
  21. float - is for decimals.
  22.  
  23. datetime
  24. timestamp - store the date and time into a column.
  25.  
  26. date
  27. time - store either the date only or time only.
  28.  
  29. binary - is for storing data such as images, audio, or movies.
  30.  
  31. boolean - is for storing true or false values.

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.