Opened 3 years ago
Closed 3 years ago
#33248 closed Uncategorized (invalid)
inspectdb command doesn't introspect on_delete option.
Reported by: | Jiangshan00001 | Owned by: | nobody |
---|---|---|---|
Component: | Database layer (models, ORM) | Version: | 3.2 |
Severity: | Normal | Keywords: | |
Cc: | Triage Stage: | Unreviewed | |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
when i use inspectdb command.
the on_delete parameter of the ForeignKey field is always DO_NOTHING.
but my database is not set as DO_NOTHING.
I noticed that the output file has this line:
"Make sure each ForeignKey and OneToOneField has on_delete
set to the desired behavior"
I'd like to know,
why no don't get the information from database?
is this a bug, or just no use for some reason?
Change History (1)
comment:1 by , 3 years ago
Component: | Uncategorized → Database layer (models, ORM) |
---|---|
Resolution: | → invalid |
Status: | new → closed |
Summary: | inspectdb command. foreignkey on_delete always get DO_NOTHING → inspectdb command doesn't introspect on_delete option. |
Note:
See TracTickets
for help on using tickets.
Replying to Jiangshan00001:
Django doesn't support database-level cascade options and doesn’t create an SQL constraint in the database, so there is no way to introspect it, see #21961.