[Django]-Django SQLite foreign key mismatch error

0👍

Try to add “to_field” argument to field “item” in “pur_history” class like this:

item = models.OneToOneField(item_info, to_field='serial_num', on_delete=models.CASCADE)

I hope this works, it worked for me

Leave a comment