3YOURMIND/django-replace-migrations

Missing top level package

jayvdb opened this issue · 3 comments

When I install, this is the layout

/usr/lib/python3.8/site-packages/django_replace_migrations-0.0.1-py3.8.egg-info
/usr/lib/python3.8/site-packages/django_replace_migrations-0.0.1-py3.8.egg-info/PKG-INFO
/usr/lib/python3.8/site-packages/django_replace_migrations-0.0.1-py3.8.egg-info/SOURCES.txt
/usr/lib/python3.8/site-packages/django_replace_migrations-0.0.1-py3.8.egg-info/dependency_links.txt
/usr/lib/python3.8/site-packages/django_replace_migrations-0.0.1-py3.8.egg-info/requires.txt
/usr/lib/python3.8/site-packages/django_replace_migrations-0.0.1-py3.8.egg-info/top_level.txt
/usr/lib/python3.8/site-packages/django_replace_migrations-0.0.1-py3.8.egg-info/version.txt
/usr/lib/python3.8/site-packages/management
/usr/lib/python3.8/site-packages/management/__init__.py
/usr/lib/python3.8/site-packages/management/__pycache__
/usr/lib/python3.8/site-packages/management/__pycache__/__init__.cpython-38.opt-1.pyc
/usr/lib/python3.8/site-packages/management/__pycache__/__init__.cpython-38.pyc
/usr/lib/python3.8/site-packages/management/commands
/usr/lib/python3.8/site-packages/management/commands/__init__.py
/usr/lib/python3.8/site-packages/management/commands/__pycache__
/usr/lib/python3.8/site-packages/management/commands/__pycache__/__init__.cpython-38.opt-1.pyc
/usr/lib/python3.8/site-packages/management/commands/__pycache__/__init__.cpython-38.pyc
/usr/lib/python3.8/site-packages/management/commands/__pycache__/makemigrations.cpython-38.opt-1.pyc
/usr/lib/python3.8/site-packages/management/commands/__pycache__/makemigrations.cpython-38.pyc
/usr/lib/python3.8/site-packages/management/commands/__pycache__/replacemigrations.cpython-38.opt-1.pyc
/usr/lib/python3.8/site-packages/management/commands/__pycache__/replacemigrations.cpython-38.pyc
/usr/lib/python3.8/site-packages/management/commands/makemigrations.py
/usr/lib/python3.8/site-packages/management/commands/replacemigrations.py
/usr/share/doc/packages/python3-django-replace-migrations
/usr/share/doc/packages/python3-django-replace-migrations/README.md
/usr/share/licenses/python3-django-replace-migrations
/usr/share/licenses/python3-django-replace-migrations/LICENSE

There is a missing package name , under which management should be.

flixx commented

Hello @jayvdb - thanks for testing this. I fixed it.

This project here was not really intended to get maintained though, as it would be quite hard to keep in-sync with different django versions - that's why I asked here to get this into Django itself, but I guess you are coming from there.

To test the command, the workflow would be:

  • Install the package with pips -e command
  • Add django_replace_migrations to your installed apps
  • Run something like ./manage.py makemigrations --replace-all -n replace_1_0 [all] [your] [apps]

Felix

I actually found this by googling for interesting solutions for https://gitlab.com/thelabnyc/django-oscar/django-oscar-bluelight/-/issues/4 , which is a messy diverged fork of a swappable model with migrations in each branch that overlap. In that case I suspect the only existing production client using the software is able to be commercially hand-held across any painful transition, and untangling the mess isnt worth the pain as there is only one client. Squashing will fix the problem temporarily, or simply re-using/abusing 0001, but the two forks are still not converged with their migrations - the leaf nodes are still different. I was hoping to use replace-migrations to effectively create merge points in the migration tree, by manually adding replaces on the forked copy of mainline migrations, listing the divergent migrations that the mainline migration incorporates.

For me, the workflow starts with installing https://build.opensuse.org/package/show/home:jayvdb:django/python-django-replace-migrations

flixx commented

@jayvdb FYI:

I published this on https://pypi.org/project/django-replace-migrations/ and added a README here...