On Nov 30, 2007 4:53 AM, Michael Koziarski <[EMAIL PROTECTED]> wrote:

>
> > Josh's rake task looks like it provides a nice ability to load data
> > via Rake.  But there is an inconsistent message being sent by Rails:
> >
> > Use Migrations.  Use Migrations.  Use Migrations.
> >
> > Except for testing, where we'll use a limited, one-off method (schema
> > dumper) ensuring that you'll never know if your migrations are broken
> > until it's too late.
>
> You run your migrations against your development database,  it's
> hardly as bad as you're implying :).
>
> > Is there a good reason for the avoidance of migrations for building
> > the test DB, or is the use of schema dumper just a vestige of days
> > gone by?  I continue to be surprised by the lack of comments from the
> > core team on this thread (Koz's early comment being the only one) and
> > the lack of feedback on ticket 8389.
>
> Migrations are designed for cases where the data in your db matters,
> with cases like a test database you might as well just drop and
> recreate every table.


Many times drop and recreate the database is not works, especially when you
have some functions which
is beyon the ability of active_records, such as view schema, contrib
function in postgresql, etc.

I have wrote a post about "testing with postgresql". Hope it's meaningful.

http://sishen.lifegoo.com/?p=50


>
> But more than that,  *most* of the migrations in my current
> application (200ish out of 300ish) are for maintaining *data*, they
> don't make schema changes at all.   Things like fixing up data after a
> bug messed it up, changing the prices of various plans, altering
> lookup data  Etc.   My test database doesn't need to know about them.
> Schema.rb works fine, I'm not sure what additional benefits you're
> looking for.
>
>
>
> > For those of you that have bought into migrations like I have, add
> > your thoughts (or improvements) to the patch on ticket 8389.
> >
> > -Chris
> >
> >
> > On Nov 28, 5:22 pm, "Josh Knowles" <[EMAIL PROTECTED]> wrote:
> > > On 11/13/07, Stephen Touset <[EMAIL PROTECTED]> wrote:
> > >
> > > > 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.
> > >
> > > I've written a simple rake task that loads any .rb files found within
> > > the RAILS_ROOT/db/fixtures/RAILS_ENV directory.  I've bundled it up as
> > > a plugin if anyone else wants to try it out:
> http://code.google.com/p/db-populate/.  README, examples, etc. to come
> > > soon.
> > >
> > > --
> > > Josh Knowles
> > > phone: 509-979-1593
> > > email:  [EMAIL PROTECTED]
> >
> > > web:    http://joshknowles.com
> > >
> >
>
>
>
> --
> Cheers
>
> Koz
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
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