I have been trying to remove a master doctype, firstly I removed the master reference from the children by setting masterContentType to 0 in the cmsContentType table - But now I can't delete the redundant master or any of its properties (I get the following FK error)
The DELETE statement conflicted with the REFERENCE constraint "FK_cmsPropertyData_cmsPropertyType". The conflict occurred in database "nForum", table "dbo.cmsPropertyData", column 'propertytypeid'. The statement has been terminated.
Been looking through and can't see what I need to delete now in the table to remove this constraint.
Sounds like you need to remove any saved property data from the cmsPropertyData table first before you can remove the properties themselves, and then the master page.
Before you continue, do you have documents in your database depending on documenttype that uses this master, if so you will probably have a corrupted database once you deleted the master from db. That is also the errormessage you get, you have data based on this documenttype.
Maybe the doctype extensions package from Matt will solve this for you?
@Richard, unfortunatley DTE doesn't work with 4.6 yet. I'm hoping to take a look at it this weekend.
@Lee, Richard makes a good point about pages already using the doc type. You can take a look at the source for DTE though, as it is only a bunch of SQL statements, then try running them manually?
Can't Delete DocType
I have been trying to remove a master doctype, firstly I removed the master reference from the children by setting masterContentType to 0 in the cmsContentType table - But now I can't delete the redundant master or any of its properties (I get the following FK error)
The DELETE statement conflicted with the REFERENCE constraint "FK_cmsPropertyData_cmsPropertyType". The conflict occurred in database "nForum", table "dbo.cmsPropertyData", column 'propertytypeid'.
The statement has been terminated.
Been looking through and can't see what I need to delete now in the table to remove this constraint.
Sounds like you need to remove any saved property data from the cmsPropertyData table first before you can remove the properties themselves, and then the master page.
Matt
HI Lee,
Before you continue, do you have documents in your database depending on documenttype that uses this master, if so you will probably have a corrupted database once you deleted the master from db. That is also the errormessage you get, you have data based on this documenttype.
Maybe the doctype extensions package from Matt will solve this for you?
Cheers,
Richard
Which umbraco version? Can't find an FK_cmsPropertyData_cmsPropertyType in the 4.5.2 DB
Thomas
@Richard, unfortunatley DTE doesn't work with 4.6 yet. I'm hoping to take a look at it this weekend.
@Lee, Richard makes a good point about pages already using the doc type. You can take a look at the source for DTE though, as it is only a bunch of SQL statements, then try running them manually?
Matt
@Matt - Ok cool I'll go through it
@Richard - Thanks, I was hoping to use his package but it doesn't work on 4.6 which is what I'm working on :(
All sorted :) Just went through all the data in the cmsPropertyData related to the master doctype that I wanted to delete and deleted it.
@Matt,
Cool will you that release include my source also?
Cheers,
Richard
@Richard, it will yes. I've just fallen behind on a few things latley.
Matt
is working on a reply...