I'm running syncdb to create an sqlite db. It was working until recently, and I don't see anything I've changed that would cause it to fail. Mostly I just changed some field names.
I have the following in models.py:
class GC_User(models.Model):
first_name = models.CharField(max_length=50)
last_name = models.CharField(max_length=50)
email = models.EmailField()
wp_userID = models.PositiveSmallIntegerField(unique=True)
When I run syncdb after deleting the old db file, I get 150 lines of traceback, the last part of which is:
File "C:\Python33\lib\site-packages\django\db\backends\util.py", line 53, in execute
return self.cursor.execute(sql, params)
File "C:\Python33\lib\site-packages\django\db\backends\sqlite3\base.py", line 450, in execute
return Database.Cursor.execute(self, query, params)
django.db.utils.OperationalError: no such table: gameconapp_gc_user
Any thoughts about what might be causing this? I can put in more of the traceback if that would be helpful.
Thanks!
Update: After much digging, my partner determined that the problem was that the application's init.py was getting called. Since a routine there tried to access the GC_User table, it got the no such table error.
For now I've commented it out so I could run syncdb, and once we're in production we won't be resetting the db, but it's counterintuitive to me that the application is being initialized before the database is set up.
I had this issue with a local SQLite 3 database. First I removed the file to be sure.
To solve this issue I used
syncdb --no-initial-data
then proceeded to usemigrate
with each app mentioned that was stated to not be synced:There is no guaranteed order so this has to be done manually and just check what order works for you. In my case the
simple_email_confirmation
app had to be done first before anything else. After a few tries,./manage.py migrate
on its own should work.