Opened 8 years ago

Closed 6 years ago

Last modified 5 years ago

#14305 closed New feature (fixed)

inspectdb should output unmanaged model definitions

Reported by: Ian Kelly Owned by: nobody
Component: Core (Management commands) Version: master
Severity: Normal Keywords: inspectdb unmanaged
Cc: Triage Stage: Accepted
Has patch: yes Needs documentation: yes
Needs tests: yes Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

I'm a little surprised that this hasn't been brought up before, but I couldn't find any existing tickets or discussion.

inspectdb should automatically set managed = False on the model definitions it creates. Since these are preexisting tables, the user almost certainly does not want Django attempting to drop them when a reset is run.

Attachments (1)

inspectdb-unmanaged.diff (439 bytes) - added by Ian Kelly 8 years ago.

Download all attachments as: .zip

Change History (11)

Changed 8 years ago by Ian Kelly

Attachment: inspectdb-unmanaged.diff added

comment:1 Changed 8 years ago by Ramiro Morales

Has patch: set
Needs documentation: set
Needs tests: set
Triage Stage: UnreviewedAccepted

Accepting on the basis this could mean user data is at risk and it is better to go with the safe choice- The additional work for the developer to remove the managed=False line would serve as an explicit opt in about allowing Django to handle the table.

Version 1, edited 6 years ago by Ramiro Morales (previous) (next) (diff)

comment:2 Changed 8 years ago by Gabriel Hurley

Component: django-admin.py inspectdbCore (Management commands)

comment:3 Changed 8 years ago by Julien Phalip

Severity: Normal
Type: New feature

comment:4 Changed 7 years ago by Jacob

milestone: 1.3

Milestone 1.3 deleted

comment:11 Changed 7 years ago by Aymeric Augustin

UI/UX: unset

Change UI/UX from NULL to False.

comment:12 Changed 7 years ago by Aymeric Augustin

Easy pickings: unset

Change Easy pickings from NULL to False.

comment:13 Changed 6 years ago by Ramiro Morales <cramm0@…>

Resolution: fixed
Status: newclosed

In 08dc90bccf7c4ffa8b04064d74b54c1150af5ff9:

Fixed #14305 -- Switched inspectdb to create unmanaged models.

Thanks Ian Kelly for the report and initial patch.

comment:14 Changed 5 years ago by Tim Graham <timograham@…>

In 9b7ba8af1b4ddb539cd69cbec9645cd873db7624:

Fixed #22322 -- Fixed incorrect explanation of what managed=False does.

refs #14305.

Thanks Adrian Klaver for the report.

comment:15 Changed 5 years ago by Tim Graham <timograham@…>

In c0a9c2f72ac289b2ba8313c6a2c56be5ed94f01d:

[1.6.x] Fixed #22322 -- Fixed incorrect explanation of what managed=False does.

refs #14305.

Thanks Adrian Klaver for the report.

Backport of 9b7ba8af1b4ddb539cd69cbec9645cd873db7624 from master

comment:16 Changed 5 years ago by Tim Graham <timograham@…>

In 7eaf329ad38ff7ea6b47f1b0a3c20ca7a5ad079b:

[1.7.x] Fixed #22322 -- Fixed incorrect explanation of what managed=False does.

refs #14305.

Thanks Adrian Klaver for the report.

Backport of 9b7ba8af1b from master

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