[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: Daniel Becroft <djcbecroft_at_gmail.com>
Date: Fri, 13 Nov 2009 08:23:11 +1000

On Thu, Nov 12, 2009 at 9:53 PM, Tony Sweeney <tsweeney_at_omnifone.com> wrote:
>
>
>> -----Original Message-----
>> From: Felix Gilcher [mailto:felix.gilcher_at_bitextender.com]
>> Sent: 12 November 2009 09:19
>> To: Thomas Harold
>> Cc: Daniel Becroft; users_at_subversion.tigris.org
>> Subject: Re: Database Development w/ SVN
>>
>> 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.
>
> There is an open source tool called 'dbdeploy' that we use for the same task.  It's not especially branch-aware, but it gets the job done for what we need.
>
> http://dbdeploy.com/

Thanks, Tony, that tool looks interesting. Unfortunately, it looks
like it's SQL only.

With this concept on an SQL system, though, do you try and minimize
the number of schema updates (as opposed to data updates) that are
made? Especially with regards to new indexes on existing tables, would
you create two different changes? Or determine all index changes
required on such a table, and apply them at once?

Regards,
Daniel B.

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=1065&dsMessageId=2417288

To unsubscribe from this discussion, e-mail: [users-unsubscribe_at_subversion.tigris.org].
Received on 2009-11-12 23:24:53 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.