On Fri, 2010-03-12 at 21:34 -0800, RichardOnRails wrote:
> Hi Craig,
> 
> Thanks for responding.
> 
> sql.db
> There doesn't appear to be such a critter in my project, although it
> was created with script/scaffold
> 
> db\schema.db
> create_table "expenses", :force => true do |t|
>     [snip]
>     t.integer  "amount",     :limit => 10, :precision => 10, :scale =>
> 0
> 
> But just before I logged in right now,  the fundamental cause of my
> problem struck me:
> When I declared expense:decimal in the scaffold,  I didn't
> declare :scale=>10, :precision=>2, which is what I want.  So there's a
> new question, I think:
> - Can I declare successive migrations where I drop column and then add
> column, or
> - can I just add those attributes to the column?
> 
> I don't care about the any data in there at the moment: it's all toy
> data for testing.
> 
> I look forward to your additional thoughts.
----
1 - When I said SQL DB, I meant the actual SQL Database that you are
using. i.e. MySQL, SQLite, PostgreSQL, etc. Do you know how to look at
your database?

2 - Get familiar with Rails API...

    http://api.rubyonrails.org/

    It has answers to so many things that you can look up for reference
and in this case, you probably want to find ActiveRecord::Migrations and
you will find that yes, you can drop/add columns and you can change
columns via migrations.

Craig


-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.

-- 
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 [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to