Re: schema change tracking

Поиск
Список
Период
Сортировка
От Benedict Holland
Тема Re: schema change tracking
Дата
Msg-id CAD+mzozj746FFE0pJC5bysJGBds4piRfxu1VUufJMzEe1O-ofw@mail.gmail.com
обсуждение исходный текст
Ответ на Re: schema change tracking  (Mark Fletcher <markf@corp.groups.io>)
Ответы Re: schema change tracking  (Adrian Klaver <adrian.klaver@aklaver.com>)
Список 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@corp.groups.io> wrote:
On Thu, May 16, 2019 at 9:41 AM Benedict Holland <benedict.m.holland@gmail.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 

В списке pgsql-general по дате отправления:

Предыдущее
От: Adrian Klaver
Дата:
Сообщение: Re: Upgrading 9.1.17 to which version?
Следующее
От: Adrian Klaver
Дата:
Сообщение: Re: schema change tracking