On Nov 13, 2007 8:17 PM, Stephen Touset <[EMAIL PROTECTED]> wrote:
> Reading the Rails commit logs, I see that db/schema.rb's purpose has
> been clarified. It's intended to be the authoritative location for
> your database schema, and rake tasks like db:reset use it to rebuild
> the schema rather than running migrations.
>
> This raises several questions for me.
>
> 1 ) What, then, is the preferred mechanism for "seed" data in the
> database? Currently, many people use migrations to insert bootstrap
> data. If schema.rb will be used for tasks like db:reset, none of this
> data will be loaded.

Good question. I'm looking forward to the answer(s).

> 2 ) What about those of us who specify additional options like charset
> or table types? This information, last time I checked, doesn't seem to
> be saved in the schema.rb.

The way to get this is `rake db:structure:dump`, which dumps the
database structure to db/<rails_env>_structure.sql. More info in this
thread from a few days ago:

 http:/xrl.us/baojk [groups.google.com/group/rubyonrails-core/...]

> 3 ) Should there be yet another database-related Rake task for
> development? Many of us create migrations, then modify them until
> we're ready to commit. A simple "rake db:reset" used to re-run the
> migrations from scratch, but the new semantics mean that migration
> changes are never reflected.

I added "db:recycle" to the GenerallyUseful plugin for just this
reason.

 http://agilewebdevelopment.com/plugins/generally_useful

It only supports MySQL at present, but I'll get to a few others when
I've got some time. Meanwhile, I'll happily take patches for anyone's
favorite non-MySQL db.

Cheers!

--j


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Core" 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-core?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to