pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Janning Vygen <vygen@gmx.de>
To: pgsql-sql@postgresql.org
Subject: thinking about versioning my database schema
Date: Mon, 4 Mar 2002 08:10:24 +0100
Message-ID: <200203040710.g247AOj05681@janning.planwerk6.local> (raw)

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



view thread (5+ messages)  latest in thread

Message-ID: <200203040710.g247AOj05681@janning.planwerk6.local>
Permalink:  ../200203040710.g247AOj05681@janning.planwerk6.local/
Also on:    postgresql.org/message-id/200203040710.g247AOj05681@janning.planwerk6.local

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: vygen@gmx.de
  Subject: Re: thinking about versioning my database schema
  In-Reply-To: <200203040710.g247AOj05681@janning.planwerk6.local>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox