Opened 13 years ago

Closed 12 years ago

#16546 closed New feature (wontfix)

syncdb should tell you when it's doing something unexpected

Reported by: Roy Smith 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

Description

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:

./manage.py 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 by Russell Keith-Magee, 13 years ago

Triage Stage: UnreviewedSomeday/Maybe
Type: BugNew 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 by Aymeric Augustin, 12 years ago

Resolution: wontfix
Status: newclosed

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