From: Bryan Date: Fri, 10 Jan 2014 08:59:30 +0000 (-0500) Subject: this should do the trick, somehow clearing Note.user values got lost X-Git-Tag: release-20150131~283 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=62b58f7332844e25fa08ee3df03e945334cf683e;p=oweals%2Fkarmaworld.git this should do the trick, somehow clearing Note.user values got lost --- diff --git a/karmaworld/apps/notes/migrations/0013_auto__chg_field_note_user.py b/karmaworld/apps/notes/migrations/0013_auto__chg_field_note_user.py index 88e5d01..fa418f6 100644 --- a/karmaworld/apps/notes/migrations/0013_auto__chg_field_note_user.py +++ b/karmaworld/apps/notes/migrations/0013_auto__chg_field_note_user.py @@ -3,6 +3,7 @@ import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models +from karmaworld.apps.notes.models import Note class Migration(SchemaMigration): @@ -14,6 +15,9 @@ class Migration(SchemaMigration): def forwards(self, orm): # Dealing with previous FK problem. + # Remove all previous foreign keys which will shortly point at the + # wrong thing. Unrecoverable change. + Note.objects.update(user=None) # Renaming column for 'Note.user' to match new field type. db.rename_column('notes_note', 'user', 'user_id') diff --git a/karmaworld/apps/users/migrations/0002_auto__del_karmauser__add_userprofile.py b/karmaworld/apps/users/migrations/0002_auto__del_karmauser__add_userprofile.py index b4404d8..45c8674 100644 --- a/karmaworld/apps/users/migrations/0002_auto__del_karmauser__add_userprofile.py +++ b/karmaworld/apps/users/migrations/0002_auto__del_karmauser__add_userprofile.py @@ -3,8 +3,6 @@ import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models -from karmaworld.apps.notes.models import Note - class Migration(SchemaMigration):