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
Add “Liquidb” to your INSTALLED_APPS setting like this:
INSTALLED_APPS = [ ... 'liquidb', ]
Run python manage.py migrate liquidb to create the liquidb models.
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
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
Built Distribution
File details
Details for the file django-liquidb-0.1.tar.gz
.
File metadata
- Download URL: django-liquidb-0.1.tar.gz
- Upload date:
- Size: 11.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/3.7.3 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.9.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2d6ef1cc6f14624a96cc9733aae2a908fe271a816f44929b57fec326978fd5cf |
|
MD5 | 5f634f8fa2a99aea23a0e70d74a669f7 |
|
BLAKE2b-256 | 7f4bed9ea750758a56c327fb4c9d18dc1d908b30e80a18bdb43cbd8ca545be2b |
File details
Details for the file django_liquidb-0.1-py3-none-any.whl
.
File metadata
- Download URL: django_liquidb-0.1-py3-none-any.whl
- Upload date:
- Size: 17.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/3.7.3 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.9.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1033e055e4cd8036b3fa6fe429c89c6c397f4d3a0e31e5ce79c4a5c429f17315 |
|
MD5 | 339b0b4a4023996f72c5a577cf0a20da |
|
BLAKE2b-256 | 2eba3e783c6b1a620940966702335bfd5fbdb213abd099058cfb7bc8a587dfcf |