{"id":13415573,"url":"https://github.com/Gusakovskiy/django-liquidb","last_synced_at":"2025-03-14T23:30:51.998Z","repository":{"id":51844252,"uuid":"343743090","full_name":"Gusakovskiy/django-liquidb","owner":"Gusakovskiy","description":"Liquidb is a Django app that simplifies migration management.","archived":false,"fork":false,"pushed_at":"2023-10-28T10:25:58.000Z","size":61,"stargazers_count":21,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-10-11T23:43:33.368Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Gusakovskiy.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2021-03-02T11:00:05.000Z","updated_at":"2024-09-22T17:33:36.000Z","dependencies_parsed_at":"2022-08-23T01:21:08.080Z","dependency_job_id":"f8ffa69e-506c-4ab1-892a-a304f77db3d3","html_url":"https://github.com/Gusakovskiy/django-liquidb","commit_stats":{"total_commits":9,"total_committers":1,"mean_commits":9.0,"dds":0.0,"last_synced_commit":"034d427c1bf6dca0ab73c964bfced4e2a4d9c6ca"},"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Gusakovskiy%2Fdjango-liquidb","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Gusakovskiy%2Fdjango-liquidb/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Gusakovskiy%2Fdjango-liquidb/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Gusakovskiy%2Fdjango-liquidb/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Gusakovskiy","download_url":"https://codeload.github.com/Gusakovskiy/django-liquidb/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243663269,"owners_count":20327299,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-07-30T21:00:50.422Z","updated_at":"2025-03-14T23:30:51.729Z","avatar_url":"https://github.com/Gusakovskiy.png","language":"Python","funding_links":[],"categories":["Third-Party Packages","Migrations"],"sub_categories":["Commands"],"readme":"# Liquidb\n\n\nLiquidb is a Django app that simplifies migration management.\nIt introduces commits (savepoints) that allows developer to take snapshot of current migration state of whole Django project.\nSnapshot introduces abstraction layer, which let you easily switch back and forth in complicated migration graph of dependent apps.\nIn order to roll(back/forward) all migrations should be revertable.\n\n\n\n## Requirements\n\nDjango Liquidb requires:\n    * Django 3.2 or later;\n    * Python 3.8 or later.\n\n\n### Getting It\n\nYou can get Django Liquidb by using pip::\n\n    $ pip install django-liquidb\n\nIf you want to install it from source, grab the git repository from GitHub and run setup.py::\n\n    $ git clone git@github.com:Gusakovskiy/django-liquidb.git\n    $ cd django-liquidb\n    $ python setup.py install\n\n\n\n### Quick start\n\n\n1. Add \"Liquidb\" to your INSTALLED_APPS setting like this:\n   ```\n    INSTALLED_APPS = [\n        ...\n        'liquidb',\n    ]\n   ```\n\n3. Run ``python manage.py migrate liquidb`` to create the liquidb models.\n4. Create initial commit ``python manage.py create_migration_snapshot --name init``\n\n### Using It\n\n\nCreate snapshot of your current state::\n\n    $ branch=$(git branch | sed -n -e 's/^\\* \\(.*\\)/\\1/p')\n    $ hash=$(git rev-parse $branch)\n    $ python manage.py create_migration_snapshot --name $branch-${hash:0:8}\n\nIn case you want to overwrite some snapshot::\n\n    $ python manage.py create_migration_snapshot --name $branch-${hash:0:8} --overwrite 1\n\n\nReturn to desired state of db::\n\n    $ python manage.py checkout_snapshot --name state_name\n\nReturn to latest snapshot::\n\n    $ python manage.py checkout_latest_snapshot\n\nIf snapshot history is messed up you always can delete it without impact on your migration state and start from scratch::\n\n    $ python manage.py delete_snapshot_history\n\n\nIf want to delete only one snapshot(it can not delete currently applied snapshot remember to checkout before that)::\n\n    $ python manage.py delete_snapshot_by_name --name name\n\n\n\nOr if you prefer admin vies you can always visit `/admin/liquidb/snapshot/` and create/apply/delete snapshot there.\n\u003e 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\n\n\n## Getting Involved\n\n\nOpen Source projects can always use more help. Fixing a problem, documenting a feature, adding\ntranslation in your language. If you have some time to spare and like to help us, here are the places to do so:\n\n- GitHub: https://github.com/Gusakovskiy/django-liquidb\n\n\n### Development\n\n\n#### Generating dependencies\n\nMain dependencies::\n\n    $ pip-compile --upgrade --resolver backtracking  --output-file requirements.txt pyproject.toml\n\nDev dependencies::\n\n    $ pip-compile --upgrade --resolver backtracking --extra dev --output-file requirements-dev.txt pyproject.toml\n\nIf you see error that you can't figure out try to add `--verbose` flag\n\n\nAfter generating dependencies remember to change `backports.zoneinfo==0.2.1` to `backports.zoneinfo;python_version\u003c\"3.9\"`\nthis dependency is not supported by Python \u003e= 3.9, it should be deleted after support for those versions is ended.\n\n\n### Configure environment\n\n\nIn you local machine create virtual environment and activate it or setup docker container and run command::\n\n    $ pip install -r requirements-dev.txt\n\nTo run test::\n\n    $ pytest tests\n\nTo run linting::\n\n    $ pylint --load-plugins=pylint_django --django-settings-module=liquidb.pylint_settings liquidb\n\n## Support\n\nDjango Liquidb is development and maintained by developers in an Open Source manner.\nAny support is welcome. You could help by writing documentation, pull-requests, report issues and/or translations.\n\nPlease remember that nobody is paid directly to develop or maintain Django Liquidb so we do have to divide our time\nbetween work/family/hobby/this project and the rest of life.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FGusakovskiy%2Fdjango-liquidb","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FGusakovskiy%2Fdjango-liquidb","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FGusakovskiy%2Fdjango-liquidb/lists"}