I am trying to change accepted_answer
ForeignKey to a BooleanField and while migrating getting the error django.db.utils.OperationalError: cannot ALTER TABLE "forum_thread" because it has pending trigger events
. This is the models.py
of before:
class Thread(models.Model):
title = models.CharField(max_length=300)
answer_count = models.PositiveIntegerField(default=0)
added_at = models.DateTimeField(auto_now_add=True)
accepted_answer = models.ForeignKey('forum.Post', null=True, blank=True, related_name='+')