The DELETE statement conflicted with the REFERENCE constraint "FK_cmsPropertyData_cmsPropertyType".
The DELETE statement conflicted with the REFERENCE
constraint "FK_cmsPropertyData_cmsPropertyType". The conflict occurred
in database "BenderMachine", table "dbo.cmsPropertyData", column
'propertytypeid'. The statement has been terminated.
I created a few properties for a child document type. I later (erroneously) created identical properties (alias) on the parent document type. When i tried to delete the properties from the parent document type i get the above error. I can delete the child properties however even after that i still cannot delete those properties on parent document type. The properties had no value (neither the child or parent doc)
I had this issue in 4.5.1 it stopped by home page from loading in backend. I updated the db so that the constraint relationship cascades on delete. That allowed me to remove properties and my home page came back to life.
Well, it's not really a big issue at the moment, for a client we created a lot of properties to manage real estate objects, we have one "master" real estate object, with properties like city,citypart and neighbourhood, but when we started building the website, we realised that it was easier to create documenttypes for city,citypart and neighbourhood a sitestructure which is equal to those. So i wanted to delete them from the real estate documenttype, which failed..
I told our client to ignore them, and placed them in the properties tab, but i think it's nice to delete them, if they aren't used.
We are not upgraded to 4.5.1 yet, since we are gonna launch the site monday, and we do have a stable environment at the moment, and we think it's to riscy to upgrade 2 days before going life.
I've upgraded from 4.5.0 to 4.5.1, but I still have this exception. Somehow the constraint relationship is not updated. Should I do this manually or is there a better way to fix this?
Thomas, I think there were two rules that needed to be changed to Cascade. I forgot the other one, but normally you get the information in the error stack trace.
We can use below SQL code to manually delete nodes which creates problem.
DELETE FROM dbo.cmsPropertyData WHERE contentNodeId IN (67898);
DELETE FROM dbo.cmsContentVersion WHERE ContentId IN (67898);
DELETE FROM dbo.cmsPreviewXml WHERE nodeId IN (67898);
DELETE FROM dbo.cmsDocument WHERE nodeId IN (67898);
DELETE FROM dbo.cmsMember2MemberGroup WHERE Member IN (67898);
DELETE FROM dbo.cmsMember WHERE nodeId IN (67898);
DELETE FROM dbo.cmsContentXml WHERE nodeId IN (67898);
DELETE FROM dbo.cmsContent WHERE nodeId IN (67898);
ALTER TABLE umbracoNode NOCHECK CONSTRAINT FK_umbracoNode_umbracoNode_id;
DELETE FROM umbracoNode WHERE id in (67898);
ALTER TABLE umbracoNode CHECK CONSTRAINT FK_umbracoNode_umbracoNode_id;
The DELETE statement conflicted with the REFERENCE constraint "FK_cmsPropertyData_cmsPropertyType".
The DELETE statement conflicted with the REFERENCE constraint "FK_cmsPropertyData_cmsPropertyType". The conflict occurred in database "BenderMachine", table "dbo.cmsPropertyData", column 'propertytypeid'.
The statement has been terminated.
I created a few properties for a child document type. I later (erroneously) created identical properties (alias) on the parent document type. When i tried to delete the properties from the parent document type i get the above error. I can delete the child properties however even after that i still cannot delete those properties on parent document type. The properties had no value (neither the child or parent doc)
I had to manually remove the items from cmsPropertyData table and then from the cmsPropertyType table.
We had the same problem..
I noticed that this still happens when you try to delete a property on a documenttype that has other inherited doctypes.
Noticed shortly after i posted this, that this should be fixed 4.5.1 (was running 4.5)
Sjors,
I had this issue in 4.5.1 it stopped by home page from loading in backend. I updated the db so that the constraint relationship cascades on delete. That allowed me to remove properties and my home page came back to life.
Regards
Ismail
Well, it's not really a big issue at the moment, for a client we created a lot of properties to manage real estate objects, we have one "master" real estate object, with properties like city,citypart and neighbourhood, but when we started building the website, we realised that it was easier to create documenttypes for city,citypart and neighbourhood a sitestructure which is equal to those. So i wanted to delete them from the real estate documenttype, which failed..
I told our client to ignore them, and placed them in the properties tab, but i think it's nice to delete them, if they aren't used.
We are not upgraded to 4.5.1 yet, since we are gonna launch the site monday, and we do have a stable environment at the moment, and we think it's to riscy to upgrade 2 days before going life.
I've upgraded from 4.5.0 to 4.5.1, but I still have this exception. Somehow the constraint relationship is not updated. Should I do this manually or is there a better way to fix this?
Jeroen
Jeroen,
I did it manually cascade on delete and that sorted the problem.
regards
ismail
Jeroen,
I did it manually cascade on delete and that sorted the problem.
regards
ismail
Clear, but this means that the issue is still not fixed in 4.5.1 .....
Really funny, i was just updating the Jira issue about this for a client ;)
It's probably fixed for a clean umbraco 4.5.1 install, but might go wrong for an upgrade from 4.5.0 to 4.5.1.
Jeroen
We experienced a similar issue with the following key when trying to delete a tab:
FK_cmsPropertyType_cmsTab
We used the same method Ismail mentioned which was to add a "cascade" on delete to this key.
I just ran into the same issue with Umbraco 4.5.2...
Surlely this is a grave enough bug to deserve some attention!
How do I clean this up? delete the row from cmsPropertyType or does it require additional actions?
This did it for us:
Then as a last step manually delete the property from the doctype
Vote up this issue here: http://umbraco.codeplex.com/workitem/29007
Just ran into this problem in 4.7 and changing the relationship between cmsPropertyType and cmsPropertyData for delete to "cascade", works fine.
L
just ran into this issue in 4.7
just to confirm what i will try changing in SQL Server Management Studio
is this under the table for cmsPropertyType > Constraints or is this somewhere else?
just ran into this issue in 4.7
just to confirm what i will try changing in SQL Server Management Studio
is this under the table for cmsPropertyType > Constraints or is this somewhere else?
Just got this in 4.7.2.
just to confirm this fix as outlined above did work for me in 4.7.1. and would i think work the same in 4.7.2
Yes I got this with a somewhat weird datatype in my CMS. Adding the on delete cascade delete fixed it and I used another data type.
I also got it in 4.7.1
But adding didn't seem to fix the problem - or have I misunderstood something.
Thomas, I think there were two rules that needed to be changed to Cascade. I forgot the other one, but normally you get the information in the error stack trace.
I fixed the issue by updating the two tables below:
Thanks Nazm - that did the trick!! :o)
We can use below SQL code to manually delete nodes which creates problem.
is working on a reply...