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
Post a Comment