I have a question on an association in custom content model.
Earlier had created an association named as avs:imageAttachment in our module. And created some content.
But later on , the design was changed in next release and to make it more flexible the association avs:imageAssociation was removed from the content model and a association crm:imageAttchment was added to custom relationship model named as crm-relationship-model.xml in Repository> Data Dictionary> Models and we are using that in code for creation of content.
Now the old contents which are having avs:imageAttachment are not being deleted. Is there any way that the avs:imageAttachment can be replaced to crm:imageAttachment in database and SOLR?
Normally it is not recommended to make changes in custom content model.
If you have to then you should make only incremental changes in it.
It means add something rather than removing or changing the existing stuff in your model.
If you have removed/changed something in the content model then such problem will occur.
As a solution you can remove all the old contents before deploying new content model. Then deploy new content model and upload the contents with your fresh newly deployed content model. This is advisable in case of very less amount of documents already created of old type.
Later on it was above entry was renmoved from the content model and the below extract was added to Repository> Data Dictionary> Models>crm-relationship-model.xml with association name as crm:imageAttachment
At this point of time we are not able to delete the earlier smartlinks:
1. Is there any way that we can query avs:imageAttachment association in our repository. 2. Also , if there is any way to replace all "avs:imageAttchment " to"crm:imageAttchment". 3. Please let us know if both above would be db query or lucene query. (With this approach earlier contents can be reused.
we need to add another custom relationship model file and add avs:imageAttachment in that xml file. And then delete. With this approach earlier content cannot be reused.