migration - How to create a model in rails 3 with 2 columns that has a string length = 8 and decimal(2,2)? -


how can create database table column has string length = 8 , decimal(2,2) using rails 3 migration?

you're right, isn't in guide have check docs. see column method:

http://api.rubyonrails.org/classes/activerecord/connectionadapters/tabledefinition.html

add_table :foo |t|   t.string :foobar, :length => 8   t.decimal :foobat, :precision => 4, :scale => 2 end 

Comments

Popular posts from this blog

linux - Using a Cron Job to check if my mod_wsgi / apache server is running and restart -

actionscript 3 - TweenLite does not work with object -

jQuery Ajax Render Fragments OR Whole Page -