[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: versioning a [small] MySQL database with svn?

From: Basile STARYNKEVITCH <basile_at_starynkevitch.net>
Date: 2005-02-27 19:21:42 CET

Le Sun, Feb 27, 2005 at 11:03:15AM -0700, Ed MacDonald écrivait/wrote:
> Hook scripts are a server-side and working copies are client-side so a hook
> script can't run "inside the working copy". If you really want to do this,
> you would need to wrap the svn client. There has been talk of client-side
> hooks on this list before but I can't recall what the consensus was.
> In your scenario, every time I commit any file, you would dump the database
> and try to commit it too just in case it has changed. It seems to me that
> this would needlessly slow down the development process.

Not in my case. Running the mysqldump command is a small fraction of a
second. I'm very far from having the mysqldump time be
annoying.... The current mysqldump time is about 0.01s (ten
milliseconds of real time) but 5 seconds would be acceptable and is
five hundred times bigger!

Actually I am experimenting with a sort of rule-based bootstrapped
language implementation, and my system is made of a small MySQL
database with a set of C source files (mostly generated by my system
itself). I want to version control my entire system, this means both
the MySQL database and the (mostly generated) C files. Of course, I
don't backup compiled binary files (ie .o and .so files and the main

> Are you talking about dumping just the schema or the data as well? Every
> application I've been involved with required some "seed" data. In your
> scenario you either have to manage seed data separately from the schema, or
> end up checking in test/development data along with your schema thus
> polluting your seed data.

I dump the entire MySQL database. As I said before, this database is
small. Currently, the mysqldump output size is a dozen kilobytes, and
it won't grow past a megabyte or two (which is a manageable size);
running the mysqldump command is very quick.

> Here is what works for me. I use three files for the DB (Schema.sql,
> SeedData.sql, TestData.sql). Then every night during the build the DB gets
> dumped/dropped/recreated before unit tests are run. The dump is a temporary
> file just in case someone forgot to update the DB files in source
> control.

A big thanks for your suggestion.

I'll probably wrapup the svn commit command in my own script (which
will call mysqldump before).


Basile STARYNKEVITCH         http://starynkevitch.net/Basile/ 
email: basile<at>starynkevitch<dot>net 
aliases: basile<at>tunes<dot>org = bstarynk<at>nerim<dot>net
8, rue de la Faïencerie, 92340 Bourg La Reine, France
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Sun Feb 27 19:23:55 2005

This is an archived mail posted to the Subversion Users mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.