thinking about versioning my database schema - Mailing list pgsql-sql

From Janning Vygen
Subject thinking about versioning my database schema
Date
Msg-id 200203040710.g247AOj05681@janning.planwerk6.local
Whole thread Raw
Responses Re: thinking about versioning my database schema  (Roberto Mello <rmello@cc.usu.edu>)
List pgsql-sql
Hi,

I had always problems when sharing my database development with 
others via cvs. Every developer has its own database to test and to 
run the program. But if he gets the new files via cvs which updates 
the db schema, it should be an automatic process which brings the 
database up to date.

I want to ask you if it is a reasonable way doing it like this:

1. In src/sql/updates developers can put files like 
update1_explain.sql

2. every database has a table like
create table _version (time timestamp, filename text);

3. after cvs update every developer should run a little script which 
tests if there are files in src/sql/updates which are not in the 
table _version. If so, it runs psql -f src/sql/updates/filename and 
doing an insert of a new line in table _version. If there are more 
files to update, they will be run in the numbered order.

So i am saving the schema version inside the databse. Is it a good 
idea? or is it nonsens and there is a much better way how to do it?

I dont want to recreate the database every time because i want to 
keep my testdata present.

regards 
janning


pgsql-sql by date:

Previous
From: "Josh Berkus"
Date:
Subject: Re: - Finding records in sequence
Next
From: David BOURIAUD
Date:
Subject: Re: About persistent connections...