pgmigrate

Simple tool to evolve PostgreSQL schema easily.

Github星跟蹤圖

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.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.

主要指標

概覽
名稱與所有者yandex/pgmigrate
主編程語言Python
編程語言Makefile (語言數: 5)
平台
許可證PostgreSQL License
所有者活动
創建於2016-10-02 23:36:29
推送於2025-10-08 19:00:48
最后一次提交2025-10-08 18:57:52
發布數11
最新版本名稱1.0.10 (發布於 )
第一版名稱v1.0.0 (發布於 2016-10-03 23:53:11)
用户参与
星數658
關注者數22
派生數63
提交數88
已啟用問題?
問題數16
打開的問題數0
拉請求數17
打開的拉請求數0
關閉的拉請求數17
项目设置
已啟用Wiki?
已存檔?
是復刻?
已鎖定?
是鏡像?
是私有?