Skip to content
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

Open
mmohtta opened this issue Aug 11, 2017 · 8 comments
Open

Cascade delete doesn't work for related models #12

mmohtta opened this issue Aug 11, 2017 · 8 comments
Assignees
Labels

Comments

@mmohtta
Copy link

mmohtta commented Aug 11, 2017

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"
}

@rocknrolla777
Copy link
Owner

I'll check! Thank you!

@rocknrolla777 rocknrolla777 self-assigned this Oct 25, 2017
@Alexisvt
Copy link

I have the same issue! Any update on this?, and thanks by the way for this great add-on!

@rocknrolla777
Copy link
Owner

@Alexisvt Tomorrow I'm going to check and fix it) Also I'm planning to create community in Slack! So, just wait for updates)

@Alexisvt
Copy link

Awesome! At the end I had to create my own but I will wait for the fix! Thanks 😃

@rocknrolla777
Copy link
Owner

hey guys, tests work fine. Is it actual issue?

@rocknrolla777
Copy link
Owner

@mmohtta Could you provide address model configuration?

@mmohtta
Copy link
Author

mmohtta commented Feb 7, 2018

@rocknrolla777 do you mean model config file or data sources and connectors used too ?

@rocknrolla777
Copy link
Owner

model config file

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants