Opened 4 years ago

Closed 3 years ago

#16546 closed New feature (wontfix)

syncdb should tell you when it's doing something unexpected

Reported by: RoySmith Owned by: nobody
Component: Database layer (models, ORM) Version: 1.3
Severity: Normal Keywords:
Cc: Triage Stage: Someday/Maybe
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no


syncdb is documented that it will not alter an existing table. This is fine, but it should at least print a warning message when you run it. As it is, it just prints:

./ syncdb
Creating tables ...
Installing custom SQL ...
Installing indexes ...
No fixtures found.

It should say something like "WARNING: Foo model changed, you must update the database manually". Otherwise, people who never noticed this little nugget (or have long since forgotten it) will just have no clue why its not doing what you asked it to do.

Change History (2)

comment:1 Changed 4 years ago by russellm

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Triage Stage changed from Unreviewed to Someday/Maybe
  • Type changed from Bug to New feature

I'm going to mark this as a feature request, rather than a bug. I can certainly see the value in what you're describing. However, in order to generate the warning, we need to be able to identify that a model has changed, and that's not a trivial thing to evaluate. The current non-warning isn't incorrect; it's just not as helpful as it could be.

In the bigger picture, this is part of the whole schema migration problem that Django has historically left to third parties like South. We want to get some of those capabilities integrated into Django's core, but it's a matter of getting the work done.

comment:2 Changed 3 years ago by aaugustin

  • Resolution set to wontfix
  • Status changed from new to closed

Schema introspection is complicated; we aren't going to bother with it just to print a warning.

The real solution will come from schema migrations. See #5934.

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