Make the check_migrations command a direct alias of makemigration

It already more or less was, but it previously did some machinations
around copying and modifying the database settings.  These on-the-fly
changes to the database connection no longer work after the
rearrangement of settings files, so let's just get rid of it.
This commit is contained in:
Jeff Bradberry 2021-05-03 11:01:52 -04:00
parent 72a940bef1
commit 686d750ad9

View File

@ -1,13 +1,5 @@
from django.db import connections
from django.db.backends.sqlite3.base import DatabaseWrapper
from django.core.management.commands.makemigrations import Command as MakeMigrations
class Command(MakeMigrations):
def execute(self, *args, **options):
settings = connections['default'].settings_dict.copy()
settings['ENGINE'] = 'sqlite3'
if 'application_name' in settings['OPTIONS']:
del settings['OPTIONS']['application_name']
connections['default'] = DatabaseWrapper(settings)
return MakeMigrations().execute(*args, **options)
pass