On Friday, 13 April 2012 19:33:07 UTC+1, alex3627 wrote: > > Here is a repetition of what exactly I have done: > > 1. Add this field in my models.py > > 2. Run " python manage.py sql jobs" (jobs is the name of the directory); > in this step the field in question is explicitly written to stdout > > 3. Run "python manage.py syncdb" > > 4. Run "python manage.py runserver" > > 5. Go to the admin webpage to look at "jobs", and get this error. > > Maybe I missed something? Or had the wrong order? Even if I repeat those > steps I get the same result. > >> >> So, as Timothy says, you added since you originally ran syncdb. The documentation[1] is clear that this doesn't work: "Syncdb will not alter existing tables syncdb will only create tables for models which have not yet been installed. It will never issue ALTER TABLE statements to match changes made to a model class after installation. Changes to model classes and database schemas often involve some form of ambiguity and, in those cases, Django would have to guess at the correct changes to make. There is a risk that critical data would be lost in the process. If you have made changes to a model and wish to alter the database tables to match, use the sql command to display the new SQL structure and compare that to your existing table schema to work out the changes."
Or, as Timothy also said, use South. [1]:https://docs.djangoproject.com/en/1.3/ref/django-admin/#syncdb -- DR. -- You received this message because you are subscribed to the Google Groups "Django users" group. To view this discussion on the web visit https://groups.google.com/d/msg/django-users/-/gmtPdIXAu7sJ. To post to this group, send email to django-users@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.