South migration error, cant update models with author column
Following along with the lesson until around the 15 minute mark where we added the foreignkey "author", and then had to run the schemamigration.
For some reason it hasn't been working at all for me. Here is the traceback:
$ python manage.py migrateRunning migrations for blog: - Migrating forwards to 0003_add_author_to_blog_posts.
blog:0002_initial FATAL ERROR - The following SQL query failed: CREATE TABLE "blog_post" ("id" serial NOT NULL PRIMARY KEY, "created_at" timestamp with time zone NOT NULL, "updated_at" timestamp with time zone NOT NULL, "title" varchar(255) NOT NULL, "slug" varchar(255) NOT NULL, "content" text NOT NULL, "published" boolean NOT NULL) The error was: relation "blog_post" already exists
Error in migration: blog:0002_initial DatabaseError: relation "blog_post" already exists
Any ideas what could be causing this or how to fix it?
Thanks!
Answers
Ok, I spoke to soon.
With some more intrepid googling, found the stackoverflow solution. Here is the link.
http://stackoverflow.com/questions/17615510/south-database-error-relation-already-exists
Basically I accidentally ran the --initial command twice, and confused south as to which migration was the actual initial migration.