summaryrefslogtreecommitdiffstats
path: root/forum/migrations/0013_add_response_count__to_user.py
diff options
context:
space:
mode:
Diffstat (limited to 'forum/migrations/0013_add_response_count__to_user.py')
-rw-r--r--forum/migrations/0013_add_response_count__to_user.py28
1 files changed, 18 insertions, 10 deletions
diff --git a/forum/migrations/0013_add_response_count__to_user.py b/forum/migrations/0013_add_response_count__to_user.py
index 5cd906a7..30ca164e 100644
--- a/forum/migrations/0013_add_response_count__to_user.py
+++ b/forum/migrations/0013_add_response_count__to_user.py
@@ -7,19 +7,27 @@ from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
-
- # Adding field 'Activity.junk'
- db.add_column(
- u'auth_user',
- 'response_count',
- self.gf('django.db.models.fields.IntegerField')(default=0, ),
- keep_default=False
- )
+ """adds integer field User.response_counter
+ if the field does not yet exist
+ this case checking is necessary to support syncdb of auth models
+ a bit hacky but we have to do it as long as we keep patching auth models
+ within the forum application
+ """
+ try:
+ db.add_column(
+ u'auth_user',
+ 'response_count',
+ self.gf('django.db.models.fields.IntegerField')(default=0, ),
+ keep_default=False
+ )
+ except:
+ print 'probably already have column User.response_count'
+ pass
def backwards(self, orm):
-
- # Deleting field 'Activity.junk'
+ """remove field User.respose_count
+ """
db.delete_column(u'auth_user', 'response_count')