I’m trying to the upgrade to the new version of Mediathread. I pulled the new code and got through bootstrap ok, but when I try to run migrate this happens:
———————
bell@meptest:/var/www/mediathread$ ./manage.py migrate --settings=mediathread.settings_production
Running migrations for courseaffils:
- Migrating forwards to 0001_initial.
> courseaffils:0001_initial
FATAL ERROR - The following SQL query failed: CREATE TABLE "courseaffils_course" ("id" serial NOT NULL PRIMARY KEY, "group_id" integer NOT NULL UNIQUE, "title" varchar(1024) NOT NULL, "faculty_group_id" integer NULL)
The error was: relation "courseaffils_course" already exists
Error in migration: courseaffils:0001_initial
Traceback (most recent call last):
File "./manage.py", line 10, in <module>
execute_from_command_line(sys.argv)
File "/var/www/mediathread/ve/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 399, in execute_from_command_line
utility.execute()
File "/var/www/mediathread/ve/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 392, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/var/www/mediathread/ve/local/lib/python2.7/site-packages/django/core/management/base.py", line 242, in run_from_argv
self.execute(*args, **options.__dict__)
File "/var/www/mediathread/ve/local/lib/python2.7/site-packages/django/core/management/base.py", line 285, in execute
output = self.handle(*args, **options)
File "/var/www/mediathread/ve/local/lib/python2.7/site-packages/south/management/commands/migrate.py", line 111, in handle
ignore_ghosts = ignore_ghosts,
File "/var/www/mediathread/ve/local/lib/python2.7/site-packages/south/migration/__init__.py", line 220, in migrate_app
success = migrator.migrate_many(target, workplan, database)
File "/var/www/mediathread/ve/local/lib/python2.7/site-packages/south/migration/migrators.py", line 256, in migrate_many
result = migrator.__class__.migrate_many(migrator, target, migrations, database)
File "/var/www/mediathread/ve/local/lib/python2.7/site-packages/south/migration/migrators.py", line 331, in migrate_many
result = self.migrate(migration, database)
File "/var/www/mediathread/ve/local/lib/python2.7/site-packages/south/migration/migrators.py", line 133, in migrate
result = self.run(migration, database)
File "/var/www/mediathread/ve/local/lib/python2.7/site-packages/south/migration/migrators.py", line 114, in run
return self.run_migration(migration, database)
File "/var/www/mediathread/ve/local/lib/python2.7/site-packages/south/migration/migrators.py", line 84, in run_migration
migration_function()
File "/var/www/mediathread/ve/local/lib/python2.7/site-packages/south/migration/migrators.py", line 60, in <lambda>
return (lambda: direction(orm))
File "/var/www/mediathread/ve/local/lib/python2.7/site-packages/courseaffils/migrations/0001_initial.py", line 17, in forwards
('faculty_group', self.gf('django.db.models.fields.related.ForeignKey')(blank=True, related_name='faculty_of', null=True, to=orm['auth.Group'])),
File "/var/www/mediathread/ve/local/lib/python2.7/site-packages/south/db/generic.py", line 47, in _cache_clear
return func(self, table, *args, **opts)
File "/var/www/mediathread/ve/local/lib/python2.7/site-packages/south/db/generic.py", line 361, in create_table
"columns": ', '.join([col for col in columns if col]),
File "/var/www/mediathread/ve/local/lib/python2.7/site-packages/south/db/generic.py", line 282, in execute
cursor.execute(sql, params)
File "/var/www/mediathread/ve/local/lib/python2.7/site-packages/django/db/backends/util.py", line 53, in execute
return self.cursor.execute(sql, params)
File "/var/www/mediathread/ve/local/lib/python2.7/site-packages/django/db/utils.py", line 99, in __exit__
six.reraise(dj_exc_type, dj_exc_value, traceback)
File "/var/www/mediathread/ve/local/lib/python2.7/site-packages/django/db/backends/util.py", line 53, in execute
return self.cursor.execute(sql, params)
django.db.utils.ProgrammingError: relation "courseaffils_course" already exists
————
I assume it has lost track of which migrations have already been run as part of the previous install. Do you have any suggestions?
Thanks,
- John