user = models.OneToOneField(User, unique=True)
Exception Type: ProgrammingError at /scripts/users/
Exception Value: column users.user_id does not exist
LINE 1: SELECT "users"."id", "users"."user_id", "users"."email", "us..
Hello,
did you run manage.py migrate?
When you add a ForeignKey or OneToOne to a model, what actually gets stored in the DB is the ID of the referenced object (in this case, a auth.models.User). So the user_id column should be created for you during the next makemigrations+migrate combo.
On a side note, giving a plural name to your models is bad practise, especially if you use the builtin admin site.
Best,
Gergely
--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.
To post to this group, send email to django...@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/3e89ccba-dcb9-42ef-b084-c6cc4b7d6891%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.