arogachev / yii2-excel

ActiveRecord import and export based on PHPExcel for Yii 2 framework
Other
64 stars 25 forks source link

IntegrityException error importing rows with same pk #33

Open makroxyz opened 8 years ago

makroxyz commented 8 years ago

This fix allows to update the previous imported row with the new one (of course by pk) oherwise it throws \yii\db\IntegrityException

arogachev commented 8 years ago

Could you provide an example of data which leads to this error?

makroxyz commented 8 years ago

I have this incremental (last overwrite previous) XLS and SN is pk

SN qty 1111111 5 2222222 3 1111111 6 <---- error

arogachev commented 8 years ago

OK, I'll try to test it and investigate deeper. But what's the purpose of having two rows with the same ids?

makroxyz commented 8 years ago

A customer sends an incremental file... the same SN could change some properties in time... Il 08 giu 2016 11:58 AM, "Alexey Rogachev" notifications@github.com ha scritto:

OK, I'll try to test it and investigate deeper. But what's the purpose of having two rows with the same ids?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/arogachev/yii2-excel/pull/33#issuecomment-224544206, or mute the thread https://github.com/notifications/unsubscribe/AB-VvaiNwNb87YBN2NpKdTaKSHlyafO-ks5qJpJWgaJpZM4Iwpwr .