I am hoping someone has experienced this before.
I have a data model in Alfresco that defines a few types and a few aspects.
For example Type X has mandatory aspects A and B.
As part of developing my application on top, I need to add a new aspect to type X. But when I add my new mandatory aspect and deploy my amp model, all the existing data for type X will no longer show up in my new queries trying to join on aspect X.
Does anyone know a seamless way to fix this?
Ideally some script that could be run that would analyze the model, match type names, and apply any missing aspects to instances of that type. This way the model could evolve with one script to evolve the data, and all of our queries could evolve with the data model in a coherent path.
Here is an example...
So lets say we have this query for our type X
SELECT P:nameSpace:aspect.nameSpace.propertyA
FROM nameSpace:typeX AS primary
JOIN nameSpace:aspect AS P:nameSpace:aspect
ON primary.cmis:objectId=P:nameSpace:aspect.cmis:objectId
Anytime we make an object X we will always have the aspect applied since it is mandatory. Now a few weeks later we add mandatory aspect2. And we need property B from it...
SELECT P:nameSpace:aspect.nameSpace.propertyA, P:nameSpace:aspect2.nameSpace.propertyB
FROM nameSpace:typeX AS primary
JOIN nameSpace:aspect AS P:nameSpace:aspect
ON primary.cmis:objectId=P:nameSpace:aspect.cmis:objectId
JOIN nameSpace:aspect2 AS P:nameSpace:aspect2
ON primary.cmis:objectId=P:nameSpace:aspect2.cmis:objectId
Our query has evolved with our data model, but the old instances of typeX will not be returned since they do not have aspect2 applied yet. Our theory is we can run a script to apply the missing aspects without versioning; and seamlessly evolve our content with our application.