[Answer]-Django: change foreignkey constraint name

1👍

This is the error:
(1054, “Unknown column ‘curve.feature_id_id’ in ‘field list'”)
So, if you don’t want to specify the db_column as user257543 supposes,
you could write instead

feature = models.ForeignKey(Feature)

which is even cleaner

0👍

Not sure about the constraint/index names but I was able to solve this by using the ‘db_column’ field option on the ForeignKeyField

feature_id = models.ForeignKey(Feature,db_column='feature_id')

Leave a comment