Git Product home page Git Product logo

pgmigrate's Introduction

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.

pgmigrate's People

Contributors

secwall avatar avmhawk avatar man-brain avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.