Search Postgresql Archives

Re: Version Control Software for Database Objects

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxxxxxxx
Proximity Pty Ltd  http://www.proximity.com.au/
  http://www4.tpg.com.au/users/rita_tim/

---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command
   (send "unregister YourEmailAddressHere" to majordomo@xxxxxxxxxxxxxx)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux