Skip to content

Commit

Permalink
fixed migration 124 for transactional databases
Browse files Browse the repository at this point in the history
  • Loading branch information
evgenyfadeev committed Jul 24, 2012
1 parent b459613 commit 05e6133
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ class Migration(SchemaMigration):

def forwards(self, orm):
# Adding field 'Post.is_private'
db.start_transaction()
db.add_column('askbot_post', 'is_private',
self.gf('django.db.models.fields.BooleanField')(default=False),
keep_default=False)
Expand All @@ -20,11 +21,15 @@ def forwards(self, orm):

# Changing field 'ReplyAddress.post'
db.alter_column('askbot_replyaddress', 'post_id', self.gf('django.db.models.fields.related.ForeignKey')(null=True, to=orm['askbot.Post']))
db.commit_transaction()

try:
db.start_transaction()
# Adding field 'User.interesting_tags'
db.add_column(u'auth_user', 'email_signature', self.gf('django.db.models.fields.TextField')(blank=True, default = ''), keep_default=False)
db.commit_transaction()
except:
db.rollback_transaction()
pass

def backwards(self, orm):
Expand Down

0 comments on commit 05e6133

Please sign in to comment.