|
@@ -1,7 +1,6 @@
|
|
|
import io
|
|
|
import os
|
|
|
import sys
|
|
|
-import warnings
|
|
|
from itertools import takewhile
|
|
|
|
|
|
from django.apps import apps
|
|
@@ -18,7 +17,6 @@ from django.db.migrations.questioner import (
|
|
|
from django.db.migrations.state import ProjectState
|
|
|
from django.db.migrations.utils import get_migration_name_timestamp
|
|
|
from django.db.migrations.writer import MigrationWriter
|
|
|
-from django.utils.deprecation import RemovedInDjango20Warning
|
|
|
from django.utils.six import iteritems
|
|
|
from django.utils.six.moves import zip
|
|
|
|
|
@@ -52,11 +50,6 @@ class Command(BaseCommand):
|
|
|
'-n', '--name', action='store', dest='name', default=None,
|
|
|
help="Use this name for migration file(s).",
|
|
|
)
|
|
|
- parser.add_argument(
|
|
|
- '-e', '--exit', action='store_true', dest='exit_code', default=False,
|
|
|
- help='Exit with error code 1 if no changes needing migrations are found. '
|
|
|
- 'Deprecated, use the --check option instead.',
|
|
|
- )
|
|
|
parser.add_argument(
|
|
|
'--check', action='store_true', dest='check_changes',
|
|
|
help='Exit with a non-zero status if model changes are missing migrations.',
|
|
@@ -69,15 +62,8 @@ class Command(BaseCommand):
|
|
|
self.merge = options['merge']
|
|
|
self.empty = options['empty']
|
|
|
self.migration_name = options['name']
|
|
|
- self.exit_code = options['exit_code']
|
|
|
check_changes = options['check_changes']
|
|
|
|
|
|
- if self.exit_code:
|
|
|
- warnings.warn(
|
|
|
- "The --exit option is deprecated in favor of the --check option.",
|
|
|
- RemovedInDjango20Warning
|
|
|
- )
|
|
|
-
|
|
|
# Make sure the app they asked for exists
|
|
|
app_labels = set(app_labels)
|
|
|
bad_app_labels = set()
|
|
@@ -186,9 +172,6 @@ class Command(BaseCommand):
|
|
|
self.stdout.write("No changes detected in apps '%s'" % ("', '".join(app_labels)))
|
|
|
else:
|
|
|
self.stdout.write("No changes detected")
|
|
|
-
|
|
|
- if self.exit_code:
|
|
|
- sys.exit(1)
|
|
|
else:
|
|
|
self.write_migration_files(changes)
|
|
|
if check_changes:
|