ValueError: The database backend does not accept 0 as a value for AutoField.
I am seeing this error when I run "python manage.py migrate askbot" My database is MySQL and its version is "Server version: 5.5.34-0ubuntu0.12.04.1"
I set up mysql using :
- sudo apt-get install build-essential
- python-dev libmysqlclient-dev sudo
- pip install mysql-python
- sudo apt-get install python-mysqldb
- sudo apt-get install mysql-server
I tried:
- python manage.py migrate askbot 0054 #migrate normally up to the 54th migration
- python manage.py migrate askbot 0055 --fake #skip this migration
- python manage.py migrate askbot #finish migrating askbot
- python manage.py migrate #finish migrating anything else (if necessary)
But I got error at #89, #92 and #98
Comments
I've made some changes in the migrations and was able to install with mysql without errors. However, I have not seen errors that you did.
I'm experiencing the same problem. It seems there's a problem in the migration files. The following StackOverflow post suggest to remove the default value for foreign keys: http://stackoverflow.com/questions/15169001/south-raises-valueerror-when-trying-to-migrate If you want to keep the default value it seems you can still use None instead of 0 or False: http://rpki.net/ticket/607 It would be great if you could fix this. Thanks a lot!
I just tested this and it works indeed. I had to edit the following migrations: 0055,0080,0093,0099 (two lines)
I have raised a pull request that fixes this issue but it hasn't been merged yet: https://github.com/ASKBOT/askbot-devel/pull/207%3C/p (https://github.com/ASKBOT/askbot-devel/pull/207</p<>>)