-
-
Notifications
You must be signed in to change notification settings - Fork 299
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Middleware to warn for unapplied migrations #1696
Labels
€ 50 bounty
See bounty-program milestone
Milestone
Comments
brymut
added a commit
to brymut/Kiwi
that referenced
this issue
Jun 22, 2020
brymut
added a commit
to brymut/Kiwi
that referenced
this issue
Jun 22, 2020
brymut
added a commit
to brymut/Kiwi
that referenced
this issue
Jun 22, 2020
brymut
added a commit
to brymut/Kiwi
that referenced
this issue
Jun 23, 2020
brymut
added a commit
to brymut/Kiwi
that referenced
this issue
Jun 24, 2020
brymut
added a commit
to brymut/Kiwi
that referenced
this issue
Jun 26, 2020
brymut
added a commit
to brymut/Kiwi
that referenced
this issue
Jun 26, 2020
brymut
added a commit
to brymut/Kiwi
that referenced
this issue
Jun 28, 2020
brymut
added a commit
to brymut/Kiwi
that referenced
this issue
Jun 28, 2020
brymut
added a commit
to brymut/Kiwi
that referenced
this issue
Jun 30, 2020
brymut
added a commit
to brymut/Kiwi
that referenced
this issue
Jun 30, 2020
brymut
added a commit
to brymut/Kiwi
that referenced
this issue
Jun 30, 2020
brymut
added a commit
to brymut/Kiwi
that referenced
this issue
Jun 30, 2020
brymut
added a commit
to brymut/Kiwi
that referenced
this issue
Jun 30, 2020
brymut
added a commit
to brymut/Kiwi
that referenced
this issue
Jul 1, 2020
brymut
added a commit
to brymut/Kiwi
that referenced
this issue
Jul 1, 2020
brymut
added a commit
to brymut/Kiwi
that referenced
this issue
Jul 1, 2020
brymut
added a commit
to brymut/Kiwi
that referenced
this issue
Jul 1, 2020
brymut
added a commit
to brymut/Kiwi
that referenced
this issue
Jul 1, 2020
brymut
added a commit
to brymut/Kiwi
that referenced
this issue
Jul 1, 2020
brymut
added a commit
to brymut/Kiwi
that referenced
this issue
Jul 1, 2020
brymut
added a commit
to brymut/Kiwi
that referenced
this issue
Jul 1, 2020
brymut
added a commit
to brymut/Kiwi
that referenced
this issue
Jul 1, 2020
brymut
added a commit
to brymut/Kiwi
that referenced
this issue
Jul 1, 2020
brymut
added a commit
to brymut/Kiwi
that referenced
this issue
Jul 1, 2020
brymut
added a commit
to brymut/Kiwi
that referenced
this issue
Jul 1, 2020
brymut
added a commit
to brymut/Kiwi
that referenced
this issue
Jul 1, 2020
brymut
added a commit
to brymut/Kiwi
that referenced
this issue
Jul 1, 2020
brymut
added a commit
to brymut/Kiwi
that referenced
this issue
Jul 1, 2020
brymut
added a commit
to brymut/Kiwi
that referenced
this issue
Jul 1, 2020
brymut
added a commit
to brymut/Kiwi
that referenced
this issue
Jul 1, 2020
brymut
added a commit
to brymut/Kiwi
that referenced
this issue
Jul 5, 2020
brymut
added a commit
to brymut/Kiwi
that referenced
this issue
Jul 5, 2020
brymut
added a commit
to brymut/Kiwi
that referenced
this issue
Jul 5, 2020
brymut
added a commit
to brymut/Kiwi
that referenced
this issue
Jul 5, 2020
brymut
added a commit
to brymut/Kiwi
that referenced
this issue
Jul 5, 2020
brymut
added a commit
to brymut/Kiwi
that referenced
this issue
Jul 5, 2020
brymut
added a commit
to brymut/Kiwi
that referenced
this issue
Jul 5, 2020
brymut
added a commit
to brymut/Kiwi
that referenced
this issue
Jul 5, 2020
brymut
added a commit
to brymut/Kiwi
that referenced
this issue
Jul 5, 2020
brymut
added a commit
to brymut/Kiwi
that referenced
this issue
Jul 5, 2020
atodorov
pushed a commit
that referenced
this issue
Jul 6, 2020
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Not applying migrations can break upgrades and we've already seen installations out in the wild which have upgraded their docker containers without applying the migrations. This can result in serious data loss going forward if users do not upgrade their installations properly.
Django already contains the base functionality that we need:
./manage.py showmigrations
will show empty boxes[ ]
in case a migration has not been applied.It is possible to use
call_command
(see tcms/core/tests/test_set_domain.py) and then parse the output but preferably we can hunt down a specific function in Django that lists all of the migrations and can reuse it instead of relying on text parsing.Then all of that should be bundled in a middleware, similar to
CheckSettingsMiddleware
(or even inside of it) and if there are unapplied migrations add warning to the request. It will be displayed in the browser.Definition of Done:
call_command
. If this isn't possible directly I need explanation & justification in the PR discussion how Django counts the migrations and which are applied/which aren't and why it won't be possible to use Django's internals for what we need.Hints:
django.core.management.base.check_migrations()
This issue is part of Kiwi TCMS open source bounty program. For more information see the link(s) in bounty-program milestone
The text was updated successfully, but these errors were encountered: