Closed tkempf closed 5 years ago
@tkempf could you create / update tests for this scenario?
I'll see what i can do, but i will be on holidays for the next 3 weeks now. BTW. i ran your tests and testDeleteQueryBuilder fails here ... There was 1 failure:
1) Askedio\Tests\IntegrationTest::testDeleteQueryBuilder Failed asserting that a row in the table [profiles] does not match the attributes { "deleted_at": null }.
Found: [ { "id": "1", "user_id": "1", "phone": "1231231234", "created_at": "2019-08-07 05:52:46", "updated_at": "2019-08-07 05:52:46", "deleted_at": null } ].
@tkempf I will review it and merge on laravel 6.
@tkempf It will be accepted today, sorry for delay.
no Problem. I'm not in a hurry ;-) btw. i think this pr should solve issue #81, or am i wrong ?
This PR does not solve problem #81 because the restore will restore all deleted items instead of items deleted by the item being restored.
ah, i missed that one. should read better next time ...
No problem, thanks!
@tkempf that change is available in version 6.0.1.
softcascade should not change deleted_at timestamps of already deleted childmodels, becaus this could break unique Indexes on pivot tables. E.g. i had a parent model wich contains n child models at position 0..n. to ensure each position is only user once for every parent i created a unique index over the columns parent.id,position and deleted_at in the pivot table. when deleteing the parent Model softcascade tries to change all of the related childmodels to the same deleted_at timestamp, which will not work with the unique index. As i can't see no use in changing all the timestamp of already deleted items, i made this PR Kind Regards Tom