Can I delete a property/association from model?

cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Active Member II

Can I delete a property/association from model?

I want to purge old properties from model, so I remove all properties from nodes according Tom Vandepoele answer in using JavaScript.

Can I update amp without old properties on model xml?

4 Replies
Highlighted
Advanced

Re: Can I delete a property/association from model?

Not completely sure, but if you are updating your content model (with existing data), and removing some properties defined in it, this is considered a non-incremental change in content model. Just try in a test environment, but I imagine that SOLR will show a WARNING message with model not updated (failed to validate model update).

Regards.

--C.

Highlighted
Senior Member

Re: Can I delete a property/association from model?

Hi, 

As Cesar Capillas has mentioned, you can't remove the property from the model if the contents of that type are already created.

However, you can create a new type with the changes you want and change the type of existing contents. 

While creating model, if you are not sure which properties to keep and remove from the model, then you should create aspects with such properties. Aspects can easily be added or removed from the content.

Thanks,

Kalpesh

ContCentric

Highlighted
Member II

Re: Can I delete a property/association from model?

Have simillar issue. I've got an existing model with many properties which are not used. Many space is occupied in table alf_node_properties (with empty data in all ***_value columns ). What can I do in this case ? Is manually trimming model definition, removing data from alf_node_properties and performing full rebuild any cure ??

Highlighted
Senior Member

Re: Can I delete a property/association from model?

Alfresco has very limited support for model changes. 

Any change you do should be compatible with all previous model versions since Alfresco doesn't have a concept of model versioning and all nodes (even the read only version2Store nodes) must validate against the latest model.xml. So you should be very, very careful when adding or modifying a property in your model since this may cause trouble months later when you don't expect it.

Removing properties is possible in therory but if you also want to delete the properties in the database (which are not removed automatically) you shold be very careful not to brake your whole system. If you do anything wrong, no support may assist you.

In most cases you need to recreate the solr index after modifying the model and/or db.

 

On the other hand: Why should alfresco occupy 'many space' in table alf_node_properties? Only one column contains a value and if a sting value is empty, your db shouldn't consume reasonable data since varchars only consume storage for characters stored.