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

Re: Database Development w/ SVN

From: Felix Gilcher <felix.gilcher_at_bitextender.com>
Date: Thu, 12 Nov 2009 10:19:18 +0100

On Nov 12, 2009, at 4:12 AM, Thomas Harold wrote:

> On 11/10/2009 3:44 PM, Daniel Becroft wrote:
>> Hi all,
>>
>> This is more of a best or general practice question than anything
>> else. How do you manage/version external database schema and static
>> data changes in an SVN environment?
>
> Small static tables could be dumped to a .sql type plain text file
> (which is usually just a big SQL INSERT statement) and kept in SVN.
> Figure one file per table.
>
> You could probably put the create table queries in .sql files as well.

I usually keep a set of scripts that does the required changes in svn. This seems to be a pretty standard practice, you might want to have a look at activerecord migrations (ruby on rails) or doctrine migrations (php) for an example. Basically it's a set of sequentially numbered scripts that each update the database from the previous version to the next version, doing all table changes and data manipulation that are required. Usually there's a table in the database that somehow stores the current version. Migrations may incorporate the ability to revert the changes if required. There's some communication involved if multiple persons are changing the database, the solution to that really depends on your workflow.

felix

--
Felix Gilcher
Bitextender GmbH
Paul-Heyse-Str. 6
D-80336 München
felix.gilcher_at_bitextender.com
http://www.bitextender.com/
Amtsgericht München, HRB 174280
Geschäftsführer: David Zülke, Florian Clever
------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=1065&dsMessageId=2416930
To unsubscribe from this discussion, e-mail: [users-unsubscribe_at_subversion.tigris.org].
Received on 2009-11-12 10:20:20 CET

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.