{ "info": { "author": "Christopher Cordero", "author_email": "ccordero@protonmail.com", "bugtrack_url": null, "classifiers": [ "License :: OSI Approved :: GNU General Public License v3 (GPLv3)", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7" ], "description": "# Django Auto Rebase\n\n## What is this?\nThis is a command-line tool that allows you to rebase a conflicting Django\nmigration on top of the other Django migration renaming (and renumbering) the\nmigration filename and also editing the `dependencies` attribute on the\n`Migration` class within the file.\n\n## Installation\n```bash\n$ pip install django-auto-rebase\n```\n\n## Usage\n```bash\n$ dar [app-name] [migration-file-to-be-rebased]\n```\n\n## Requirements\n* Python 3.7 (for now. file an issue if you need an earlier version supported)\n* Django 2.2 (earlier versions will likely work, but it's untested for now.\n\n## Limitations\n* Only works on leaf nodes that have migration conflicts.\n* Only works on leaf nodes within the same app.\n\n## FAQ\n### Is this a Django Command?\nNo, although this package is tightly coupled to Django, it is NOT a Django\napp that you need to add to your `INSTALLED_APPS` or call through a `manage.py`.\n\n### How does it find the root Django path?\nThe first thing the script does after parsing your arguments is it walks up\nthe current working directory until it finds the `manage.py` file that all if\nnot most Django applications have. The folder that holds the first\n`manage.py` directory is appended to `sys.path`.\n\n### Why do you even need this?\nWell, you don't really need it, but _I_ find it helpful.\n\nSuppose the migration tree looks like this:\n```\n0001_xxx <-- 0002_xxx <-- 0003_xxx\n```\n\nThen two developers, working in separate branches, generate their own `0004_xxx`\nmigration. Once the first developer gets their code merged to master, the\nsecond developer's migration tree is immediately stale/in conflict because\n_its_ `0004_xxx` will still be pointing at `0003_xxx` as a dependency. You\nmay find yourself getting this error message:\n\n```\nConflicting migrations detected; multiple leaf nodes in the migration graph:\n(0004_xxx, 0004_yyy in my_app_name).\nTo fix them run 'python manage.py makemigrations --merge'\n```\n\nAs the message suggests, you could run `makemigrations --merge`, which\ngenerates a new leaf node `0005_xxx` and specifies the two `0004_xxx`\nmigrations as a dependencies. This works in small doses, but I'm not a huge fan.\n(see below)\n\n### What's wrong with makemigrations --merge?\nThe magic numbers of each migration starts meaning less and less.\n\nStrictly speaking, they really do mean nothing - Django doesn't care at all\nabout the number: A 0004_xxx migration could depend on a migration named\n9999_xxx, which depends on 1234_xxx.\n\nPractically speaking, I do find value in seeing the dependency order of the\nmigration tree follow their actual numbers. This tool helps rebase two conflicting\nmigrations with ease.\n\n\n## Author\n\n[Christopher Sabater Cordero](https://github.com/cs-cordero)\n", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/cs-cordero/django-auto-rebase", "keywords": "django,Django,migrations", "license": "GPL-3.0", "maintainer": "Christopher Cordero", "maintainer_email": "ccordero@protonmail.com", "name": "django-auto-rebase", "package_url": "https://pypi.org/project/django-auto-rebase/", "platform": "", "project_url": "https://pypi.org/project/django-auto-rebase/", "project_urls": { "Documentation": "https://github.com/cs-cordero/django-auto-rebase", "Homepage": "https://github.com/cs-cordero/django-auto-rebase", "Repository": "https://github.com/cs-cordero/django-auto-rebase" }, "release_url": "https://pypi.org/project/django-auto-rebase/1.0.0/", "requires_dist": [ "Django (>=2.2,<3.0)" ], "requires_python": ">=3.6,<4.0", "summary": "", "version": "1.0.0" }, "last_serial": 5919540, "releases": { "1.0.0": [ { "comment_text": "", "digests": { "md5": "a46a18282813f3d0b72b94cfeca09d5a", "sha256": "3e6ca73ea7ce0246692eecbfb759bb45296c3f4c98f5903dd75d9899869b38a4" }, "downloads": -1, "filename": "django_auto_rebase-1.0.0-py3-none-any.whl", "has_sig": false, "md5_digest": "a46a18282813f3d0b72b94cfeca09d5a", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.6,<4.0", "size": 16773, "upload_time": "2019-10-02T18:51:19", "url": "https://files.pythonhosted.org/packages/a6/89/3e1d248f4e0882ae032131068319dd92f2799b9e42c23c54908fc1f8f348/django_auto_rebase-1.0.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "bbed5df28eb7607ab268fbb148aeb424", "sha256": "7edb82d799b102b0d17cf63923c09c99896f8c4f3350e7e792394f5361188d41" }, "downloads": -1, "filename": "django-auto-rebase-1.0.0.tar.gz", "has_sig": false, "md5_digest": "bbed5df28eb7607ab268fbb148aeb424", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6,<4.0", "size": 16327, "upload_time": "2019-10-02T18:51:17", "url": "https://files.pythonhosted.org/packages/4b/3e/3301f6d0c8cca2ff8340ed10161b323a8a3e1248c84773ae22951f984b72/django-auto-rebase-1.0.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "a46a18282813f3d0b72b94cfeca09d5a", "sha256": "3e6ca73ea7ce0246692eecbfb759bb45296c3f4c98f5903dd75d9899869b38a4" }, "downloads": -1, "filename": "django_auto_rebase-1.0.0-py3-none-any.whl", "has_sig": false, "md5_digest": "a46a18282813f3d0b72b94cfeca09d5a", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.6,<4.0", "size": 16773, "upload_time": "2019-10-02T18:51:19", "url": "https://files.pythonhosted.org/packages/a6/89/3e1d248f4e0882ae032131068319dd92f2799b9e42c23c54908fc1f8f348/django_auto_rebase-1.0.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "bbed5df28eb7607ab268fbb148aeb424", "sha256": "7edb82d799b102b0d17cf63923c09c99896f8c4f3350e7e792394f5361188d41" }, "downloads": -1, "filename": "django-auto-rebase-1.0.0.tar.gz", "has_sig": false, "md5_digest": "bbed5df28eb7607ab268fbb148aeb424", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6,<4.0", "size": 16327, "upload_time": "2019-10-02T18:51:17", "url": "https://files.pythonhosted.org/packages/4b/3e/3301f6d0c8cca2ff8340ed10161b323a8a3e1248c84773ae22951f984b72/django-auto-rebase-1.0.0.tar.gz" } ] }