Skip to main content

Liquidb is a Django app that simplifies migration management.

Project description

Liquidb is a Django app that simplifies migration management. It introduces commits (savepoints) that allows developer to take snapshot of current migration state of whole Django project. Snapshot introduces abstraction layer, which let you easily switch back and forth in complicated migration graph of dependent apps. In order to roll(back/forward) all migrations should be revertable.

Requirements

Django Liquidb requires:
  • Django 2.2 or later;

  • Python 3.6 or later.

Getting It

You can get Django Liquidb by using pip:

$ pip install django-liquidb

If you want to install it from source, grab the git repository from GitHub and run setup.py:

$ git clone git@github.com:Gusakovskiy/django-liquidb.git
$ cd django-liquidb
$ python setup.py install

Quick start

  1. Add “Liquidb” to your INSTALLED_APPS setting like this:

    INSTALLED_APPS = [
        ...
        'liquidb',
    ]
  2. Run python manage.py migrate liquidb to create the liquidb models.

  3. Create initial commit python manage.py create_migration_snapshot --name init

Using It

Create snapshot of your current state:

$ branch=$(git branch | sed -n -e 's/^\* \(.*\)/\1/p')
$ hash=$(git rev-parse $branch)
$ python manage.py create_migration_snapshot --name $branch-${hash:0:8}

In case you want to overwrite some snapshot:

$ python manage.py create_migration_snapshot --name $branch-${hash:0:8} --overwrite 1

Return to desired state of db:

$ python manage.py checkout_snapshot --name state_name

Return to latest snapshot:

$ python manage.py checkout_latest_snapshot

If snapshot history is messed up you always can delete it without impact on your migration state and start from scratch:

$ python manage.py delete_snapshot_history

If want to delete only one snapshot(it can not delete currently applied snapshot remember to checkout before that):

$ python manage.py delete_snapshot_by_name --name name

Or if you prefer admin vies you can always visit /admin/liquidb/snapshot/ and create/apply/delete snapshot there. > If you would like to change to readonly view in admin please change ADMIN_SNAPSHOT_ACTIONS env variable to False or overwrite it you settings

Getting Involved

Open Source projects can always use more help. Fixing a problem, documenting a feature, adding translation in your language. If you have some time to spare and like to help us, here are the places to do so:

Support

Django Liquidb is development and maintained by developers in an Open Source manner. Any support is welcome. You could help by writing documentation, pull-requests, report issues and/or translations.

Please remember that nobody is paid directly to develop or maintain Django Liquidb so we do have to divide our time between work/family/hobby/this project and the rest of life.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

django-liquidb-0.2.tar.gz (15.2 kB view details)

Uploaded Source

Built Distribution

django_liquidb-0.2-py3-none-any.whl (22.8 kB view details)

Uploaded Python 3

File details

Details for the file django-liquidb-0.2.tar.gz.

File metadata

  • Download URL: django-liquidb-0.2.tar.gz
  • Upload date:
  • Size: 15.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.9.5

File hashes

Hashes for django-liquidb-0.2.tar.gz
Algorithm Hash digest
SHA256 300bd0c1b1a52bcdaff4c62dc7bf7b56706265766b0b17ac639a7b18f2e68c81
MD5 ffdba4acf188f53501baa3e0e530c563
BLAKE2b-256 640b1f0716e28b826c3616daf5cdab9a1fc53fc85afacdfce2ee7f362336fd45

See more details on using hashes here.

File details

Details for the file django_liquidb-0.2-py3-none-any.whl.

File metadata

  • Download URL: django_liquidb-0.2-py3-none-any.whl
  • Upload date:
  • Size: 22.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.9.5

File hashes

Hashes for django_liquidb-0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 5408433cbff86b13d087b6258518338a1d2f3fa4fbfc6a0148507f71ebfbb808
MD5 49a6304d3abe4a9f716d6a8c11ebbdb5
BLAKE2b-256 fa6f1f04d5c8af05705ac146b7c9c277e4902a03fc6234c0b7f4fff099844c55

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page