Answer the question
In order to leave comments, you need to log in
Django why migration error?
We have: python3, django2, postgresql.
There was a model:
class UserSettings(models.Model):
"""Настройки юзера"""
user = models.OneToOneField(
to=User,
on_delete=models.CASCADE,
related_name='settings',
verbose_name='Юзер'
)
class Folder(models.Model):
"""Папка"""
title = models.CharField(
max_length=255,
verbose_name='Название'
)
class UserSettings(models.Model):
"""Настройки юзера"""
user = models.OneToOneField(
to=User,
on_delete=models.CASCADE,
related_name='settings',
verbose_name='Юзер'
)
folder = models.ForeignKey(
to=Folder,
on_delete=None,
null=True,
blank=True
)
Answer the question
In order to leave comments, you need to log in
ProgrammingError relation "accounts_folder" does not exist.
python manage.py makemigrations
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question