I created an extension of the standard user model in models.py called Client. I added a manytomany relationship to it to indicate which clients are related to another:
class Client(models.Model):
user = models.OneToOneField(User, on_delete=models.CASCADE)
clients = models.ManyToManyField("self", blank=True)
This works perfectly fine in my local dev environment where I use python manage.py runserver. However, when I try to run python manage.py migrate on our testing server using a postgresql database, I get the following error:
psycopg2.errors.InvalidForeignKey: there is no unique constraint matching given keys for referenced table "content_client"
What am I missing here?