mirror of
https://github.com/django/django.git
synced 2025-10-31 09:41:08 +00:00
Fixed #22676 -- makemigrations --dry-run should not ask for defaults
Made the fix in InteractiveMigrationQuestioner class code, rather than MigrationAutodetector, because --dry-run shouldn't affect whether MigrationAutodetector will detect non-nullable fields, but the questioner should skip the question and returns a None for default (since that won't be used anyway) if --dry-run is used.
This commit is contained in:
23
tests/migrations/test_migrations_no_default/0001_initial.py
Normal file
23
tests/migrations/test_migrations_no_default/0001_initial.py
Normal file
@@ -0,0 +1,23 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from django.db import models, migrations
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.CreateModel(
|
||||
name='SillyModel',
|
||||
fields=[
|
||||
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
|
||||
('silly_field', models.BooleanField(default=False)),
|
||||
],
|
||||
options={
|
||||
},
|
||||
bases=(models.Model,),
|
||||
),
|
||||
]
|
||||
Reference in New Issue
Block a user