Re: Question: How do you manage version control?

Поиск
Список
Период
Сортировка
От Ralf Schuchardt
Тема Re: Question: How do you manage version control?
Дата
Msg-id 44373888-683B-44E3-9CC7-E6D18765AF24@gmx.de
обсуждение исходный текст
Ответ на Question: How do you manage version control?  (Bryan Montgomery <monty@english.net>)
Ответы Re: Question: How do you manage version control?  (Robert Gravsjö <robert.gravsjo@imano.se>)
Список pgsql-general
Hello,

am 01.06.2012 um 17:28 schrieb Bryan Montgomery:

> So we've been reviewing our processes and working on improving them. One area we've been lacking is a procedure to
versioncontrol our database functions, table changes, static data etc. 

we use a very basic system since a few years, consisting mainly of shell scripts and sql scripts processed by psql.

> I'm curious how others do it. Ideally, we want it to be part of our release / build process so that we deploy
functions.
>
> However, how do you handle dependancies?

The code for every recreatable object (i.e. views, functions, maybe types) is stored in its own file. It includes also
adrop statement for these objects and formal comments to declare dependencies between the files. The files are
processedwith a small script that extracts the dependency declarations and writes a create and drop script for all
objectswhile maintaining the correct order. 

> We've also used patch files if we need to modify tables - these are typically written to only run once, ie alter
tableadd column x int. Any thoughts on putting this in to a process so that it can be run mutliple times without any
issue?

Our database has a "versions" table, containing the version (and date) of applied patch files. Every patch file checks
thecurrent version in the database and throws an exception, when it does not match its expected version. 
The directory with the recreatable objects is versioned along the patch files.


Regards
Ralf

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

Предыдущее
От: Thomas Kellerer
Дата:
Сообщение: Re: Question: How do you manage version control?
Следующее
От: Tom Lane
Дата:
Сообщение: Re: autovacuum running for a long time on a new table with 1 row