-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cascade delete doesn't work for related models #12
Comments
I'll check! Thank you! |
I have the same issue! Any update on this?, and thanks by the way for this great add-on! |
@Alexisvt Tomorrow I'm going to check and fix it) Also I'm planning to create community in Slack! So, just wait for updates) |
Awesome! At the end I had to create my own but I will wait for the fix! Thanks 😃 |
hey guys, tests work fine. Is it actual issue? |
@mmohtta Could you provide address model configuration? |
@rocknrolla777 do you mean model config file or data sources and connectors used too ? |
model config file |
I have Person and Address Model
In Person Model there are two relations
Person hasMany Persons as Reportee
Person hasOne Address as address
Create two person records ... 1.Name:"Manager" 2. Name:"Employee",Reports to :"Manager"
Create two address ... 1.Address:"AddressOfManager",2.Address:"AddressOfEmployee"
Now delete Manager in person record
Here , Address of Employee doesn't gets deleted
==========================================================
{
"_id": "employeePayroll2",
"name": "Person",
"plural": "Persons",
"base": "PersistedModel",
"persistedModel": true,
"strict": false,
"public": true,
"idInjection": false,
"options": {
"validateUpsert": true
},
"properties": {
"personName": {
"required": false,
"label": "",
"type": "string",
"isArray": true,
"propertyName": "personName",
"id": false,
"index": false,
"description": "",
"displayInView": true,
"minLength": 0,
"maxLength": 30,
"regExp": "",
"defaultVal": ""
}
},
"relations": {
"Reportee":{
"type":"hasMany",
"model":"Person",
"foreignKey":"reportsTo"
},
"address":{
"type":"hasOne",
"model":"Address",
"foreignKey":"personId"
}
},
"mixins": {
"CascadeDelete": {
"relations": ["Reportee","address"]
}
},
"acls": [],
"methods": {},
"dataSource": "remoteMongoDB"
}
The text was updated successfully, but these errors were encountered: