pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Steve Atkins <steve@blighty.com>
To: PG-General Mailing List <pgsql-general@postgresql.org>
Subject: Re: schema change tracking
Date: Thu, 16 May 2019 17:50:01 +0100
Message-ID: <5743A1A5-A8DF-4463-9B00-0D87B32C622D@blighty.com> (raw)
In-Reply-To: <CAD+mzozAAVSGMMKwQEQh0ZMQtysxuaB2qBqksEv5wXcPJBD8Gw@mail.gmail.com>
References: <CAD+mzozAAVSGMMKwQEQh0ZMQtysxuaB2qBqksEv5wXcPJBD8Gw@mail.gmail.com>



> On May 16, 2019, at 5:41 PM, Benedict Holland <benedict.m.holland@gmail.com> wrote:
> 
> Hi All,
> 
> I am fairly this question has many answers but here it goes:
> 
> I need a tool that can track schema changes in a postgesql database, write scripts to alter the tables, and store those changes in git. Are there tools that exist that can do this?

If you're looking for something that'll reverse engineer schema change scripts from a database someone has made ad-hoc changes to ... try and avoid doing that if at all possible. Use the change scripts in git as the source of truth.

If you do that there are many answers, starting at "it's fairly easy to do yourself, with a simple schema version and upgrade / downgrade scripts". Depending on what language you're writing your app in there may be libraries that can help.

But if you're looking for something standalone, look at https://sqitch.org

Cheers,
  Steve







view thread (7+ messages)  latest in thread

Message-ID: <5743A1A5-A8DF-4463-9B00-0D87B32C622D@blighty.com>
Permalink:  ../5743A1A5-A8DF-4463-9B00-0D87B32C622D@blighty.com/
Also on:    postgresql.org/message-id/5743A1A5-A8DF-4463-9B00-0D87B32C622D@blighty.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: steve@blighty.com
  Subject: Re: schema change tracking
  In-Reply-To: <5743A1A5-A8DF-4463-9B00-0D87B32C622D@blighty.com>
  References: <CAD+mzozAAVSGMMKwQEQh0ZMQtysxuaB2qBqksEv5wXcPJBD8Gw@mail.gmail.com> <5743A1A5-A8DF-4463-9B00-0D87B32C622D@blighty.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