Re: Version Control Software for Database Objects

Поиск
Список
Период
Сортировка
От Tim Allen
Тема Re: Version Control Software for Database Objects
Дата
Msg-id 41E72942.9060807@proximity.com.au
обсуждение исходный текст
Ответ на Version Control Software for Database Objects  ("Mark Dexter" <MDEXTER@dexterchaney.com>)
Ответы Re: Version Control Software for Database Objects  (Greg Stark <gsstark@mit.edu>)
Список pgsql-general
Mark Dexter wrote:
> We maintain multiple versions of our application's database and we are
> looking for version control software to help us automate this.
> Specifically, we would like to have a program that automatically tracks
> all changes to the database (tables, views, functions, etc.) and assists
> with updating customers' databases from one version to the next.
>
> Does anyone know of such a program that works with PostgreSQL?  Thanks
> for your help.

Assuming you mean version control of the _schema_, rather than the data
therein, then no, I don't know of any such program available. However,
it's not too hard to do it yourself, which is what we've done. Create a
table which has only one row, containing a schema version number, and
build some constant into your application which has the same number -
the application should check the database schema number on startup and
complain loudly if the two don't match. Every time you release a new
version of the application that has a schema change, then both increment
the schema number and write a script that will perform the schema update
from version n to version n + 1. If you name your scripts in a
consistent way, it's not hard to then write a script that compares the
current schema version at a site with that expected by the new
application version, and incrementally runs each update script.

Tim

--
-----------------------------------------------
Tim Allen          tim@proximity.com.au
Proximity Pty Ltd  http://www.proximity.com.au/
   http://www4.tpg.com.au/users/rita_tim/

В списке pgsql-general по дате отправления:

Предыдущее
От: Jeff Davis
Дата:
Сообщение: Re: Version Control Software for Database Objects
Следующее
От: Greg Stark
Дата:
Сообщение: Re: best place to enfore rules