Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

92
Views
Django Unknown column

I have a model with the following fields

class UserProfile(models.Model):

  user = models.OneToOneField(User, unique=True, db_index=True, 
  related_name='profile')
  Email = models.EmailField(max_length=255, db_index=True, null=True)
  name = models.CharField(blank=True, max_length=255, db_index=True)

class Meta(object):
    db_table = "auth_userprofile"

in my Users panel inside the Django Adminsitration i have multiple users, when i try to acces one of them i get this following error

(1054, "Unknown column 'auth_userprofile.user_id' in 'field list'")

should i drop the table to fix this issue or there is another solution for this

over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

Dropping the table will require you to recreate it. And if you recreate it precisely as it is now, the issue will not be resolved.

This error: (1054, "Unknown column 'auth_userprofile.user_id' in 'field list'")

Is refering to a specified column, very likely in a SQL statement, where you claiming a table, auth_userprofile, has the column: user_id.

Or it could be a syntax error, and you are including the table name in the column name section, or actually quite a lot of possible errors come to mind.

The point is deleting the table will only help if you re-create it with altered column names. And dropping an entire table to either alter a column name in your code, or simply creating the column in the table seems a bit excessive?

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!