1
1
mirror of https://github.com/yandex/pgmigrate.git synced 2024-09-17 15:17:18 +03:00
Simple tool to evolve PostgreSQL schema easily.
Go to file
2020-02-29 19:10:20 +03:00
doc Use application_name instead of backend pid for conflict termination. 2019-11-02 02:31:24 +03:00
features Bump deps versions 2019-04-14 20:55:33 +03:00
.gitignore First opensource version - PGmigrate 1.0.0 2016-10-03 18:52:42 +03:00
.isort.cfg First opensource version - PGmigrate 1.0.0 2016-10-03 18:52:42 +03:00
.pylintrc First opensource version - PGmigrate 1.0.0 2016-10-03 18:52:42 +03:00
.travis.yml First opensource version - PGmigrate 1.0.0 2016-10-03 18:52:42 +03:00
AUTHORS Allow using subdirs in migrations folder 2018-04-03 06:03:44 +03:00
Dockerfile Bump postgres and yapf versions 2019-11-02 00:43:40 +03:00
LICENSE First opensource version - PGmigrate 1.0.0 2016-10-03 18:52:42 +03:00
Makefile First opensource version - PGmigrate 1.0.0 2016-10-03 18:52:42 +03:00
pgmigrate.py Update copyright and bump yapf to 0.29.0 2020-01-09 02:06:23 +03:00
README.md Release 1.0.5 2020-02-29 19:10:20 +03:00
run_test.sh Use application_name instead of backend pid for conflict termination. 2019-11-02 02:31:24 +03:00
setup.py Release 1.0.5 2020-02-29 19:10:20 +03:00
tox.ini Update copyright and bump yapf to 0.29.0 2020-01-09 02:06:23 +03:00

PyPI version Build Status

PGmigrate

PostgreSQL migrations made easy

Overview

PGmigrate is a database migration tool developed by Yandex.

PGmigrate has the following key-features:

  • Transactional and nontransactional migrations: you can enjoy whole power of PostgreSQL DDL
  • Callbacks: you can run some DDL on specific steps of migration process (e.g. drop some code before executing migrations, and create it back after migrations were applied)
  • Online migrations: you can execute series of transactional migrations and callbacks in a single transaction (so, if something goes wrong simple ROLLBACK will bring you in consistent state)

Install

pip install yandex-pgmigrate

Running tests

Tests require running PostgreSQL instance with superuser (to create/drop dbs). You could setup this yourself and use tox to start tests:

tox

Second option is to use docker and make:

make test

How to use

Complete manual is here.

Release history

  • 1.0.5 (2020-02-29)
    • Use application_name instead of backend pid for conflict termination
  • 1.0.4 (2019-04-14)
    • Allow using subdirs in migrations folder
  • 1.0.3 (2017-12-28)
    • Fix migration error with comment at the end of file
    • Add blocking pids termination
    • Some minor fixes and improvements
  • 1.0.2 (2017-04-05)
    • Speed up get_info function a bit
    • Fix callbacks in transactional/nontransactional migrations mix on db init
  • 1.0.1 (2017-04-01)
    • Fix bug with python format patterns in migration text
    • Sort info command output by version
    • Support 'latest' target version
    • Add option to override user in migration meta
    • Fix info command fail without target on initialized database
    • Add session setup option
  • 1.0.0 (2016-10-03)
    • First opensource version

License

Distributed under the PostgreSQL license. See LICENSE for more information.