From c3a5f8a4e83983a352c45eeaa550cad315dddcb7 Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Fri, 20 Apr 2012 10:36:20 -0500 Subject: Fix ContentType related migrations This should fix the issues reported in FS#23228 for the most part. Signed-off-by: Dan McGee --- news/migrations/0002_move_news_in.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'news') diff --git a/news/migrations/0002_move_news_in.py b/news/migrations/0002_move_news_in.py index d6dafad4..43d68df4 100644 --- a/news/migrations/0002_move_news_in.py +++ b/news/migrations/0002_move_news_in.py @@ -7,14 +7,19 @@ class Migration(SchemaMigration): depends_on = ( - ('main', '0001_initial'), + ('main', '0031_move_news_out'), ) def forwards(self, orm): - pass + db.send_create_signal('news', ['News']) + if not db.dry_run: + ct = orm['contenttypes.ContentType'].objects + ct.filter(app_label='main', model='news').update(app_label='news') def backwards(self, orm): - pass + if not db.dry_run: + ct = orm['contenttypes.ContentType'].objects + ct.filter(app_label='news', model='news').update(app_label='main') models = { 'auth.group': { -- cgit v1.2.3-54-g00ecf