GithubHelp home page GithubHelp logo

liquimigrate's Introduction

Liquibase migrations with django.

https://pypip.in/v/liquimigrate/badge.png https://pypip.in/d/liquimigrate/badge.png

License: BSD Liquibase license: Apache 2.0 Author: Marek Wywiał <[email protected]>

Quick start

  • install liquimigrate, python setup.py install
  • add 'liquimigrate' to INSTALLED_APPS
  • configure LIQUIMIGRATE_CHANGELOG_FILES = { 'default': os.path.join(os.path.dirname(__file__), "migrations", "migrations.xml") in settings }
  • ensure that you have java on your path, liquibase and java drivers are embedded into package

Usage

Just run ./management.py liquibase update or ./management.py liquibase -h

To learn how to use liquibase look at liquibase documentation:

Configuration settings

  • LIQUIMIGRATE_CHANGELOG_FILES - dictionary with paths to change log files f.e. 'os.path.join(os.path.dirname(__file__), "migrations", "migrations.xml")' for every database connection you need to maintain using liquimigrate
  • old method is still supported: LIQUIMIGRATE_CHANGELOG_FILE - path to change log file f.e. 'os.path.join(os.path.dirname(__file__), "migrations", "migrations.xml")'
  • LIQUIMIGRATE_DATABASE - selected database - default 'default'

How it works

Database settings are got from DATEBASES, from key 'default' or key configured in settings.py as LIQUIMIGRATE_DATABASE.

Changelog path are got from LIQUIMIGRATE_CHANGELOG_FILES or from command line (check -h).

Supported drivers:
  • postgresql
  • mysql
  • more in future

Development

Whole command code is put in:
  • liquimigrate/management/commands/liquibase.py
  • java connectors are stored in liquimigrate/vendor/connectors
  • available drivers mapping is stored in liquimigrate/__init__.py
  • mapping to create db url for drivers is stored in liquimigrate/management/commands/liquibase.py in DB_DEFAULTS

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.