You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
CREATETABLEProduct (
id INTEGERPRIMARYKEYAUTOINCREMENT,
title TEXT)
CREATETABLEProductImage (
productId INTEGERPRIMARYKEY,
imageUrl TEXT,
FOREIGNKEY (productId) REFERENCESProduct(id) ONDELETECASCADEONUPDATENOACTION
)
When i use ConflictAlgorithm.replace, my ProductImage is deleted, instead of doing nothing with ON UPDATE NO ACTION, but i see the documentation the pre-existing rows that are causing the constraint violation are removed prior to inserting or updating the current row.
So the only way to do this is not using the .replace and do 2 QUERY DB ?
if (exists) {
// .update
} else {
// .insert
}
There is no way to do it with the .replace ?
The text was updated successfully, but these errors were encountered:
I already use the ConflictAlgorithm example :
But what happens when my tables are like this :
When i use
ConflictAlgorithm.replace
, my ProductImage is deleted, instead of doing nothing with ON UPDATE NO ACTION, but i see the documentationthe pre-existing rows that are causing the constraint violation are removed prior to inserting or updating the current row.
So the only way to do this is not using the .replace and do 2 QUERY DB ?
There is no way to do it with the .replace ?
The text was updated successfully, but these errors were encountered: