Love Fuel?    Donate

FuelPHP Forums

Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
Model_Temporal and Many_Many relations
  • I'm having an issue with the Temporal model and updating a record.  The model in question has a couple many_many relations defined and everything works as it should.  

    However when I want to update an existing record I get an 'Integrity contstraint violation: duplicate entry 'xxx-xxx' for key Primary.  The error is on the through table for the two models in question.

    What I am taking this to mean is that when the Temporal model does it's thing it is trying to re-insert existing info in the related tables.  

    Changing from Temporal to Soft fixes the issue, however I would like to use Temporal to keep track of changes to the data over time.  Is there any way to make this work with the existing framework code?  Is this a known issue and it is expected behavior?  

    Any help is appreciated!  FYI, I'm using 1.7.3.
  • Not sure temporal supports this, you might want to ping uru on irc (freenode, #fuelphp).
  • I use the same basic setup for another model elsewhere and it doesn't give me this error.  I've double- and triple-checked the code, and it follows the same procedures and setup parameters.

    I may try to go through things line-by-line but I wanted to see if anyone else had run across this issue.

    Thanks for the suggestion, Harro.  I appreciate it!

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion