|
@@ -48,6 +48,10 @@ class Command(BaseCommand):
|
|
|
'-n', '--name',
|
|
|
help="Use this name for migration file(s).",
|
|
|
)
|
|
|
+ parser.add_argument(
|
|
|
+ '--no-header', action='store_false', dest='include_header',
|
|
|
+ help='Do not add header comments to new migration file(s).',
|
|
|
+ )
|
|
|
parser.add_argument(
|
|
|
'--check', action='store_true', dest='check_changes',
|
|
|
help='Exit with a non-zero status if model changes are missing migrations.',
|
|
@@ -63,6 +67,7 @@ class Command(BaseCommand):
|
|
|
self.migration_name = options['name']
|
|
|
if self.migration_name and not self.migration_name.isidentifier():
|
|
|
raise CommandError('The migration name must be a valid Python identifier.')
|
|
|
+ self.include_header = options['include_header']
|
|
|
check_changes = options['check_changes']
|
|
|
|
|
|
|
|
@@ -188,7 +193,7 @@ class Command(BaseCommand):
|
|
|
self.stdout.write(self.style.MIGRATE_HEADING("Migrations for '%s':" % app_label) + "\n")
|
|
|
for migration in app_migrations:
|
|
|
|
|
|
- writer = MigrationWriter(migration)
|
|
|
+ writer = MigrationWriter(migration, self.include_header)
|
|
|
if self.verbosity >= 1:
|
|
|
|
|
|
|
|
@@ -288,7 +293,7 @@ class Command(BaseCommand):
|
|
|
self.migration_name or ("merge_%s" % get_migration_name_timestamp())
|
|
|
)
|
|
|
new_migration = subclass(migration_name, app_label)
|
|
|
- writer = MigrationWriter(new_migration)
|
|
|
+ writer = MigrationWriter(new_migration, self.include_header)
|
|
|
|
|
|
if not self.dry_run:
|
|
|
|