Last active
July 20, 2018 12:45
-
-
Save avalanchy/0efd50c632f37b0074cf9438e7b497ca to your computer and use it in GitHub Desktop.
Overridden Django 2 command that always creates a migration with the name "m", by which we can catch conflicts at the level of the Pull Request
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from django.core.management.commands import makemigrations | |
class Command(makemigrations.Command): | |
def handle(self, *args, **options): | |
self.stdout.write(self.style.HTTP_NOT_FOUND( | |
'This is the overridden command that always creates a migration ' | |
'with the name "m", by which we can catch conflicts at the level ' | |
'of the Pull Request.' | |
)) | |
options['name'] = 'm' | |
super().handle(*args, **options) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment