On Dec 8, 2007 11:16 AM, Alexey Verkhovsky <[EMAIL PROTECTED]> wrote: > > On Nov 30, 2007 1:35 PM, DHH <[EMAIL PROTECTED]> wrote: > > I don't think I understand this. Why do you want or need to continuously > > test the migrations? > > Let me try to explain. > * there is no up-to-date development environment on the continuous > integration box > * but I do want to rebuild the database from scratch in every CI > build. From what?
Yes, dropping the db and migrating everything is the sensible approach in CI. > * if I use db/schema.rb, I am relying on an artefact that was > automatically generated in somebody's development environment. Which > is not how it will be done in production. I also cannot expect > everybody to always pay attention when checking-in auto-generated > artefacts. Right. In general, I think it's bad practice to check in generated artifacts. It's more work for everyone to remember to check in when they change the schema. It's error prone and people often forget to check in, which means the CI build breaks and you waste time figuring out what broke, who forgot to check in, and blaming them. Better to just always run the migrations in CI and svn:ignore schema.rb. > * running all migrations then looks like a better choice. > > > Once everyone has been moved, the migrations are useless and could > > essentially be deleted. > Yeah, having many migrations floating around is awkward, too. One can > take schema dumper output and make a new baseline migration out of it, > with the same number as the DB_VERSION in the last prod release. Yep. Speeds up CI and clean DB setups too if there are fewer migrations. If there were something to automate the collapse of migrations into a schema dump up to a given version, that would be great. It's easy to do manually, but it would be a nifty rake task for someone to publish. -- Chad --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
