Forums

Migrate error 1060

_mysql.connection.query(self, query) django.db.utils.OperationalError: (1060, "Duplicate column name 'foto'")

The table has a column "foto". This field is unique in all the DB. This table doesn't had alteration. I changed "foto" to "xfoto" and the error persists. I added a new table. Makemigrations run with no error. In localhost there are no error. Thanks.

There are some steps you could take to debug, here are some ideas: check what are actual columns in that table in your PA database; investigate your migrations if you don't have duplicate definitions of foto; check if after renaming foto to xfoto Django is not trying to create foto somewhere, etc...