thinking about versioning my database schema
От | Janning Vygen |
---|---|
Тема | thinking about versioning my database schema |
Дата | |
Msg-id | 200203040710.g247AOj05681@janning.planwerk6.local обсуждение исходный текст |
Ответы |
Re: thinking about versioning my database schema
|
Список | 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 по дате отправления: