From: Bryan Date: Fri, 10 Jan 2014 08:53:44 +0000 (-0500) Subject: serious hacking to deal with existing FK data in Note ... cont'd X-Git-Tag: release-20150131~284 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=e3614ad9f8b57169a371a1e5533de3df65ed05cc;p=oweals%2Fkarmaworld.git serious hacking to deal with existing FK data in Note ... cont'd --- 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 bbfd3f3..88e5d01 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 @@ -13,6 +13,10 @@ class Migration(SchemaMigration): def forwards(self, orm): + # Dealing with previous FK problem. + # Renaming column for 'Note.user' to match new field type. + db.rename_column('notes_note', 'user', 'user_id') + # Changing field 'Note.user' db.alter_column('notes_note', 'user_id', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['auth.User'], null=True, on_delete=models.SET_NULL)) @@ -21,6 +25,10 @@ class Migration(SchemaMigration): # Changing field 'Note.user' db.alter_column('notes_note', 'user_id', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['users.KarmaUser'], null=True, on_delete=models.SET_NULL)) + # Dealing with previous FK problem. + # Renaming column for 'Note.user' to match new field type. + db.rename_column('notes_note', 'user_id', 'user') + models = { 'auth.group': { 'Meta': {'object_name': 'Group'},