This thread looks to be a little on the old side and therefore may no longer be relevant. Please see if there is a newer thread on the subject and ensure you're using the most recent build of any software if your question regards a particular product.
This thread has been locked and is no longer accepting new posts, if you have a question regarding this topic please email us at support@mindscape.co.nz
|
I like this SoftDelete feature, but I have perhaps a stupid question here when SoftDelete is enable with CascadeDeletes = true. When deleting Order, all OrderLines gets a OrderLines.OrderId=NULL When CascadeDeletes= false offcourse only Order.DeletedOn=DateTime.Now is updated and OrderLines is not touched... Could it be nice to drop the OrderLines.OrderId=NULL, but OrderLines.DeletedOn=DateTime.Now, so we keep all references... ? |
|
|
What about CascadeSoftDeletes = true or CascadeDeletes isa Enum with Normal, SoftDelete options... |
|
|
If you make the foreign key field (_orderId) non-nullable then you will get the behaviour you want -- the association is preserved (at the database level) and only the OrderLine DeletedOn column gets updated. |
|
|
Thanks :) Is this written in the documentation? |
|
|
It works to :) |
|
|
It works, but it gives another problem. When doing this off course the reference is required.
The softdelete feature is nice but it is not use if you cannot track also. It gives a problem if you a no required references, then the OrderExtra.OrderId is set to NULL. What if you could set some where that you don't want OrderExtra.OrderId it to be set to Null ifra Order is soft-deleted. |
|
|
I've logged a bug for this and we will look into it. |
|