I think a lot of Rails developers have been using the db:migrate Rake task to setup new development databases. The problem with this is that over time migrations tend to grow out of sync with the code, especially if you use model classes in your migrations (which in some cases can be very convenient and DRY). A more robust approach to setting up a development database is to load the schema and seed it with data like the db:setup Rake task in Rails 3 does. Now there are a couple of issues for us in using this approach. First we are not on Rails 3 yet (obviously), second we use schema format SQL so the db:schema:load task doesn’t work (see my patch for fixing this), and third, we don’t have a proper db/seed.rb file yet for setting up all the data that so far has been set up by our migrations. To work around these issues I came up with a task like this. The db/development_data.sql file was created by invoking the db:structure:dump task and exchanging the -s option to pg_dump with -a for data only.
About the blog
This is the blog by the Ruby on Rails developers behind Mynewsdesk.
Read more about us →
Visit Mynewsdesk →Follow us on Twitter
Search
Blogroll
-
Recent Posts
Tags
@media Analytics bit.ly data attributes design developer e-commerce editor gchartrb git googlecharts Google Charts API google charts on rails hCard html5 i18n javascript jQuery JSON litespeed Microformats newsdesk Operator Optimus passenger plugin plugins pluralization postgresql RDFa Rich snippets ruby Ruby on Rails Semantic web SEO Services swedish swedish_pluralize The environment tip Transformator translate usability Validator XML
Subscribe