rubyonrailsin

A Ruby and Rails talk

Saturday, March 13, 2010


[Rails] Re: Decimal item gets truncated at DB-storage time

by rubyonrailsin 0 comments

Tag


Share this post:
Design Float
StumbleUpon
Reddit

Thanks, again, profusely for your response.

< Do you know how to look at your database?

mysql> describe expenses;
+------------+---------------
| Field | Type
+------------+---------------
| amount | decimal(10,0)

> > Can I declare successive migrations where I drop column ...
> Get familiar with Rails API... http://api.rubyonrails.org/

Thanks for that API. Actually, I've had a tab open on
http://api.rubyonrails.org/classes/ActionView/Helpers/FormOptionsHelper.html
while trying to get a control with drop-down-selection coded ... but
that's for another day.

> It has answers to so many things that you will find that yes,
> you can drop/add columns and you can change columns via migrations.

Thank goodness for that! But I wasn't able to find "drop column" and
resorted to
http://www.oracle.com/technology/pub/articles/kern-rails-migrations.html
to find this list:

13 remove_column :albums, :year
14 rename_column :albums, :year_int, :year
15 change_column :albums, :year, :integer, :limit => 4, :null =>
false

which gave me the answer I really wanted: #15

Bottom line: you're a great resource. You pointed me in the right
directions and I got to Nirvana!

Thanks again, Craig, very much,
Richard

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

No comments:

Post a Comment

Subscribe feeds via e-mail

Blog Archive