thinking about versioning my database schema

From: Janning Vygen <vygen(at)gmx(dot)de>
To: pgsql-sql(at)postgresql(dot)org
Subject: thinking about versioning my database schema
Date: 2002-03-04 07:10:24
Message-ID: 200203040710.g247AOj05681@janning.planwerk6.local
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin 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

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Dan Langille 2002-03-04 07:51:47 Re: [SQL] thinking about versioning my database schema
Previous Message Alex Hudich 2002-03-04 05:44:47 pg_restore problem.

Browse pgsql-sql by date

  From Date Subject
Next Message David BOURIAUD 2002-03-04 07:49:50 Re: About persistent connections...
Previous Message Josh Berkus 2002-03-03 20:55:49 Re: - Finding records in sequence