This project is read-only.

ContentTypeRecord not being deleted

Topics: Core, Troubleshooting
Oct 24, 2014 at 6:31 PM
Edited Oct 24, 2014 at 6:52 PM

I am trying to learn Orchard, and poking a little bit at what its doing to the underlying database. One thing that I noticed was that content type definitions are getting stranded in the ContentTypeRecord table, and I can't figure out why.

Here are the repro steps:
  1. Create a Content Type Definition.
  2. Create an item of that type. During this add, an entry gets added into Orchard_Framework_ContentTypeRecord
  3. Delete the item, then the content definition.
  4. If you look at the ContentTypeRecord, it still exists.
The one interesting thing here is that if I create another definition with the same name, it will actually reuse the same ID. This actually makes me think it might be by design, but I'm not very clear on why this is happening?

Is the implication here that we allow Content Items for Content Types that have been deleted?

Oct 27, 2014 at 5:20 PM
I'm not entirely sure about how content type records work, but I guess this is because of the same reason why you don't see content item records being deleted: Orchard generally operates with soft deletes for content items, so if you remove an item is just gets flagged but not deleted physically.