[LRUG] Dumping A Database Ruby-Style

Andrew Stewart boss at airbladesoftware.com
Tue Dec 4 04:15:10 PST 2007


On 4 Dec 2007, at 12:03, Tom Stuart wrote:

> On 4 Dec 2007, at 11:48, Andrew Stewart wrote:
>> Is there a pure Ruby way, ideally a Rake task, to dump all the data?
>
> I don't know enough about MySQL privileges to know whether this'll
> avoid your problem, but:
>
>   * you can try dumping the schema using "rake db:schema:dump", and
> loading it the other end with "rake db:schema:load"; and
>   * the Manage Fixtures plugin (http://svn.toolbocks.com/plugins/ 
> manage_fixtures/
> ) gives you a "rake db:fixtures:export_all" task that'll export the
> current table contents into fixtures, which you can then load the
> other end with "rake db:fixtures:load".

That looks perfect.  Thank you!

The code appears to use only selects and inserts, not mysqldump, so  
it should neatly sidestep my problem.

Thanks again,
Andy Stewart

-------
http://airbladesoftware.com






More information about the Chat mailing list