From 0611db4f46f83af2b111432d30fa3acac3961929 Mon Sep 17 00:00:00 2001 From: Bryan Date: Fri, 10 Jan 2014 03:38:12 -0500 Subject: [PATCH] fixing dependencies caused by changing a foreign key. --- .../apps/notes/migrations/0013_auto__chg_field_note_user.py | 6 +++++- .../migrations/0002_auto__del_karmauser__add_userprofile.py | 6 +++++- 2 files changed, 10 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 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'] -- 2.25.1