Bug 225756 - [NEW PORT] databases/py-pum: Postgres Upgrades Manager
Summary: [NEW PORT] databases/py-pum: Postgres Upgrades Manager
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Yuri Victorovich
URL: https://github.com/opengisch/pum/
Keywords: easy, patch-ready
Depends on:
Blocks:
 
Reported: 2018-02-08 09:58 UTC by Loïc Bartoletti
Modified: 2018-03-19 06:52 UTC (History)
2 users (show)

See Also:
lbartoletti: maintainer-feedback+


Attachments
py36-pum-0.5.9 (2.87 KB, patch)
2018-02-08 09:58 UTC, Loïc Bartoletti
lbartoletti: maintainer-approval+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Loïc Bartoletti freebsd_committer freebsd_triage 2018-02-08 09:58:48 UTC
Created attachment 190425 [details]
py36-pum-0.5.9

pum

Acronym stands for "Postgres Upgrades Manager". It is a Database migration management tool very similar to flyway-db or Liquibase, based on metadata tables.
Features

Pum is python program that can be used via command line or directly from another python program.

Pum permits the followings operations on Postgres databases:

    check the differences between two databases
    create a backup (dump file) of a database
    restore a database from a backup
    upgrade a database applying delta files

and some other useful operations.
General purpose and workflow

Good practices regarding database versioning and migration are not so easy to handle in a CVS code management system. Initial developpement is easy, using pure git, and sometimes some meta SQL generation scripts. But when it comes to maintaining databases already in production, good practices differ a lot since SQL patchs can't be handled the same way as git diffs.

We recommend reading somes of those great articles to get a clearer view on what could, and should (or not) be done:

    https://blog.codinghorror.com/get-your-database-under-version-control/
    http://petereisentraut.blogspot.fr/2012/05/my-anti-take-on-database-schema-version.html

The worklow consists in having version metadata written INSIDE the database and use that to check current state, old migrations, new migrations to apply, etc..

The first thing to do is use the "baseline" command to create metadata in your database, and then you are good to go.


---
Poudriere 10/11 i386/amd64 OK
Portlint OK
Comment 1 Yuri Victorovich freebsd_committer freebsd_triage 2018-03-19 06:51:52 UTC
Committed.
Thank you for your contribution!
Comment 2 commit-hook freebsd_committer freebsd_triage 2018-03-19 06:52:08 UTC
A commit references this bug:

Author: yuri
Date: Mon Mar 19 06:51:49 UTC 2018
New revision: 464989
URL: https://svnweb.freebsd.org/changeset/ports/464989

Log:
  New port: databases/py-pum: Postgres upgrade manager

  PR:		225756
  Submitted by:	lbartoletti@tuxfamily.org

Changes:
  head/databases/Makefile
  head/databases/py-pum/
  head/databases/py-pum/Makefile
  head/databases/py-pum/distinfo
  head/databases/py-pum/pkg-descr