orm
orm copied to clipboard
Add ODKU behavior or delete childs before adding them
product has many productSkus
SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '1-kg' for key 'mt_product_sku.mt_product_sku_index_product_id_attribute_name_61a108014425b'
(1-kg ,"1" is product id and "kg" is attribute name)
string(194) "INSERT INTO `mt_product_sku` (`sequence`, `status`, `created_at`, `updated_at`, `ip_address`, `product_id`, `attribute_name`, `weight`, `price`, `quantity`) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)"
the right action should be delete the same rows or ON DUPLICATE KEY UPDATE
Originally posted by @TiaNex-Com in https://github.com/cycle/orm/discussions/342