I'm using the following MedusaJS version
Medusa CLI version: 2.0.0-rc-20241016093905
Medusa version: 2.0.0-rc-20241016093905
I've followed the instructions at https://docs.medusajs.com/v2/resources/commerce-modules/customer/extend to extend the customer data model for supporting additional required fields.
The data creation works fine.
I also followed the instruction https://docs.medusajs.com/v2/learn/advanced-development/module-links#set-delete-cascades-on-link to set the linked record to be deleted on deletion of the customer.
import { defineLink } from "@medusajs/framework/utils"
import ExtendedCustomerModule from "../modules/customer_ext"
import CustomerModule from "@medusajs/medusa/customer"
export default defineLink(
CustomerModule.linkable.customer,
{
linkable: ExtendedCustomerModule.linkable.custom,
deleteCascades: true,
}
)
I did a npx medusa db:sync-links after adding the code
But when I invoke DELETE (using cURL) - the main customer record gets deleted but the linked data is not getting deleted. The linkage record and the custom record both continue to remain in their respective tables.
Any suggestions/help would be greatly appreciated. Thanks in advance!