Removing properties from content parts

Topics: Customizing Orchard, Writing modules
Sep 20, 2012 at 1:46 PM

Hi. I've read the Skywalker and Orchard doc tutorials on content parts, but I seemed to have missed out on such a common practice. I was wondering what the best way of removing properties from a content part is? For example after I have created  the maps content part on Orchard docs, how would I go about deleting the Longitude property (what is the correct Orchard term for Longitude and Latitude in the Map part? Property or Field?) from the Map part? Do I have to define a new update in my Migrations and delete the column like this?


SchemaBuilder.AlterTable("MapPartRecord", builder => builder.DropColumn("Longitude"));

Also, do I have to manually delete the Longitude property in my Part definiton (MapRecord.cs)?

What is the best way of going about removing properties from content parts?


Thanks in advance.

Sep 21, 2012 at 7:51 PM

How about you just stop using it and leave the data there?

Sep 21, 2012 at 7:55 PM

Thanks, I actually thought about that but then for some reason I was under the impression it's best to remove it if I'm not using it.

Sep 21, 2012 at 7:57 PM

Not necessarily. We tend never to delete physical data in Orchard.