pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Adrian Klaver <adrian.klaver@aklaver.com>
To: Erik Wienhold <ewie@ewie.name>
To: Simon Connah <simon.n.connah@protonmail.com>
Cc: pgsql-general@lists.postgresql.org <pgsql-general@lists.postgresql.org>
Subject: Re: PostgreSQL DB in prod, test, debug
Date: Wed, 14 Feb 2024 08:39:36 -0800
Message-ID: <267180bd-cb81-4060-b945-47e455cbd978@aklaver.com> (raw)
In-Reply-To: <vrfriprj4bkikvqo7dwiqyfw2ld6kcj7jb26k2afnd7dllsjau@zgue6kdkoymp>
References: <NaMscvF8PaDKNcHJGR28wV7Kljc6kw4y0agCt2E3qI8hkUYUSUyj_beL825S4GfK2SjTuNVaHmRkW30ihuYmobAitd1uuLNis8nCkFCZT-0=@protonmail.com>
	<vrfriprj4bkikvqo7dwiqyfw2ld6kcj7jb26k2afnd7dllsjau@zgue6kdkoymp>

On 2/14/24 02:38, Erik Wienhold wrote:
> On 2024-02-14 10:59 +0100, Simon Connah wrote:

> 
> The database schema should be defined by migration scripts that you also
> check into version control with the rest of your application sources.
> Some people also prefer a separate repository just for the database
> schema, depending on how tightly coupled database and application are,
> or if there are other applications relying on the database schema.
> 
> I use Sqitch[1] which works well if you want to track an existing
> database schema.  Alembic is popular in Python but I don't know how it
> works with an existing schema because Alembic migrations are usually not
> written in plain SQL.

Just to be clear you can start from scratch with Sqitch. The only thing 
that needs to be done outside of it is the original CREATE DATABASE 
statement. After that you can build the contents of the database from 
the beginning. At any point you can move forward(deploy) or 
backward(revert). For your use case the important feature is target, 
where each target is a different instance of the database. In your case 
prod, test and debug. This allow you to make changes in test/debug and 
when they are verified good deploy them to prod.



-- 
Adrian Klaver
adrian.klaver@aklaver.com






view thread (8+ messages)  latest in thread

Message-ID: <267180bd-cb81-4060-b945-47e455cbd978@aklaver.com>
Permalink:  ../267180bd-cb81-4060-b945-47e455cbd978@aklaver.com/
Also on:    postgresql.org/message-id/267180bd-cb81-4060-b945-47e455cbd978@aklaver.com

 · 

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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: adrian.klaver@aklaver.com, ewie@ewie.name, simon.n.connah@protonmail.com
  Subject: Re: PostgreSQL DB in prod, test, debug
  In-Reply-To: <267180bd-cb81-4060-b945-47e455cbd978@aklaver.com>
  References: <NaMscvF8PaDKNcHJGR28wV7Kljc6kw4y0agCt2E3qI8hkUYUSUyj_beL825S4GfK2SjTuNVaHmRkW30ihuYmobAitd1uuLNis8nCkFCZT-0=@protonmail.com> <vrfriprj4bkikvqo7dwiqyfw2ld6kcj7jb26k2afnd7dllsjau@zgue6kdkoymp> <267180bd-cb81-4060-b945-47e455cbd978@aklaver.com>

* 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