From 62b58f7332844e25fa08ee3df03e945334cf683e Mon Sep 17 00:00:00 2001 From: Bryan Date: Fri, 10 Jan 2014 03:59:30 -0500 Subject: [PATCH] this should do the trick, somehow clearing Note.user values got lost --- .../apps/notes/migrations/0013_auto__chg_field_note_user.py | 4 ++++ .../migrations/0002_auto__del_karmauser__add_userprofile.py | 2 -- 2 files changed, 4 insertions(+), 2 deletions(-) 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): -- 2.25.1