Re: schema change tracking

From: Benedict Holland <benedict(dot)m(dot)holland(at)gmail(dot)com>
To: Mark Fletcher <markf(at)corp(dot)groups(dot)io>
Cc: pgsql-general <pgsql-general(at)postgresql(dot)org>
Subject: Re: schema change tracking
Date: 2019-05-16 17:55:47
Message-ID: CAD+mzozj746FFE0pJC5bysJGBds4piRfxu1VUufJMzEe1O-ofw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi All!

Thanks for the replies. I am looking for a solution, possibly 3rd party,
where I write changes to the schema and it keeps track of the changes I
made. I am used to doing stuff in pgadmin4 but I don't mind something else.

This isn't really ad-hoc. This is more like, I have a v1.0 release coming
out soon and I have made dozens or hundreds of changes to the schema from
the alpha. Right now, I can destroy the databases and recreate them without
data loss because it is in active development. When this gets released, we
need some way to make sure that we can easily migrate between release
versions and that means schema change tracking. Basically, to Steve's
concern, I don't have to go back and figure out changes (thankfully, I have
done that and it sucks) but we need something from an initial release
moving forward.

I don't have time to write my own and this problem is complex enough to
either buy a solution or go with a 3rd party application.

So far, SQITCH is looking like a winner. Yoyo can work as I have access to
python. We are not using SQLAlchemy but I don't see a reason why we can't.

Thanks all for the suggestions. This is great.
~Ben

On Thu, May 16, 2019 at 1:06 PM Mark Fletcher <markf(at)corp(dot)groups(dot)io> wrote:

> On Thu, May 16, 2019 at 9:41 AM Benedict Holland <
> benedict(dot)m(dot)holland(at)gmail(dot)com> wrote:
>
>>
>> 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?
>>
>> We ended up rolling our own. We do schema dumps and then use
> https://www.apgdiff.com/ to diff them. For our relatively simple schemas,
> it's worked fine. One thing to note, apgdiff doesn't support `ALTER TABLE
> ONLY [a-z\.]+ REPLICA IDENTITY FULL;` lines, which we just remove before
> diffing.
>
> Cheers,
> Mark
>

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Adrian Klaver 2019-05-16 17:58:51 Re: schema change tracking
Previous Message Adrian Klaver 2019-05-16 17:55:41 Re: Upgrading 9.1.17 to which version?