From: Bryan Date: Fri, 10 Jan 2014 08:38:12 +0000 (-0500) Subject: fixing dependencies caused by changing a foreign key. X-Git-Tag: release-20150131~287 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=0611db4f46f83af2b111432d30fa3acac3961929;p=oweals%2Fkarmaworld.git fixing dependencies caused by changing a foreign key. --- 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 2f71f2d..770a1d0 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 @@ -7,6 +7,10 @@ from django.db import models class Migration(SchemaMigration): + depends_on = ( + ('karmauser', '0002_auto__del_karmauser__add_userprofile'), + ) + def forwards(self, orm): # Changing field 'Note.user' @@ -138,4 +142,4 @@ class Migration(SchemaMigration): } } - complete_apps = ['notes'] \ No newline at end of file + complete_apps = ['notes'] 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 5780493..da99aed 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,11 +3,15 @@ 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): def forwards(self, orm): + # Removing all possible FK dependencies on KarmaUser from Note + Note.objects.update(user=None) + # Deleting model 'KarmaUser' db.delete_table('users_karmauser') @@ -95,4 +99,4 @@ class Migration(SchemaMigration): } } - complete_apps = ['users'] \ No newline at end of file + complete_apps = ['users']