Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

95
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda