First, I create my database.
create database mydb;
我将“南方”添加到已安装的应用程序。然后,我转到此教程:http://south.aeracode.org/docs/tutorial/part1.html
The tutorial tells me to do this:
$ py manage.py schemamigration wall --initial
>>> Created 0001_initial.py. You can now apply this migration with: ./manage.py migrate wall
Great, now I migrate.
$ py manage.py migrate wall
But it gives me this error...
django.db.utils.DatabaseError: (1146, "Table 'fable.south_migrationhistory' doesn't exist")
So I use Google (which never works. hence my 870 questions asked on Stackoverflow), and I get this page: http://groups.google.com/group/south-users/browse_thread/thread/d4c83f821dd2ca1c
Alright, so I follow that instructions
>> Drop database mydb;
>> Create database mydb;
$ rm -rf ./wall/migrations
$ py manage.py syncdb
But when I run syncdb, Django creates a bunch of tables. Yes, it creates the south_migrationhistory table, but it also creates my app's tables.
Synced:
> django.contrib.admin
> django.contrib.auth
> django.contrib.contenttypes
> django.contrib.sessions
> django.contrib.sites
> django.contrib.messages
> south
> fable.notification
> pagination
> timezones
> fable.wall
> mediasync
> staticfiles
> debug_toolbar
Not synced (use migrations):
-
(use ./manage.py migrate to migrate these)
Cool....now it tells me to migrate these. So, I do this:
$ py manage.py migrate wall
The app 'wall' does not appear to use migrations.
Alright, so fine. I'll add wall to initial migrations.
$ py manage.py schemamigration wall --initial
Then I migrate:
$ py manage.py migrate wall
You know what? It gives me this BS:
_mysql_exceptions.OperationalError: (1050, "Table 'wall_content' already exists")
Sorry, this is really pissing me off. Can someone help ? thanks.
How do I get South to work and sync correctly with everything? The only thing I can think of is remove my app from INSTALLED_APPS, then run syncdb, then add it back on.
That is SO SILLY.