Opened 11 years ago

Closed 11 years ago

Last modified 11 years ago

#22676 closed Bug (fixed)

When doing a makemigration --dry-run skip asking about default values for non-nullable fields?

Reported by: shige.abe@… Owned by: nobody
Component: Migrations Version: 1.7-beta-2
Severity: Normal Keywords:
Cc: Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: yes Patch needs improvement: no
Easy pickings: no UI/UX: yes

Description

Given that the output for --dry-run is just a summary of what's changing, I wouldn't expect to need to supply default values for new non-nullable fields.

Change History (6)

comment:1 by mardini, 11 years ago

I agree with you. No need for that step since the default value won't be used anyway.
I'll leave the ticket to a core developer to accept though.
Here's my PR: https://github.com/django/django/pull/2698
Thanks.

comment:2 by mardini, 11 years ago

Has patch: set

comment:3 by mardini, 11 years ago

Type: UncategorizedBug

comment:4 by Tim Graham, 11 years ago

Easy pickings: unset
Needs tests: set
Triage Stage: UnreviewedAccepted

comment:5 by Tim Graham <timograham@…>, 11 years ago

Resolution: fixed
Status: newclosed

In 63fc91b3cac523690655c1d86d09972e0cc3a29d:

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.

comment:6 by Tim Graham <timograham@…>, 11 years ago

In a59870e21784166725f7cb3230becef50553ee3a:

[1.7.x] 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.

Backport of ee14961a2a from master

Note: See TracTickets for help on using tickets.
Back to Top