- what is the
- how to upgrade existing CMS Model field definition
If you created your project with Webiny v5.33.0 or later, you can skip the upgrade part of the article.
As we introduced CMS Model Field aliases in v5.33.0, we introduced a new property on our CMS Model Field definitions, the
Storage ID (
We use it as the storage path for the given field value in the record. As
fieldId is now changeable, we cannot store values by the
fieldId value because it would result in the data loss each time the
fieldId value has changed.
Storage ID field comprises out of the field
type property (
object, etc…) and the
id property, which is generated via the
Here are few examples how the
storageId property value looks like this:
We are basically joining the field
type and the
id properties, because it makes it easier to target the specific field types with custom mappings in the Elasticsearch system deployment.
storageId value should never change, no matter what - you will lose data otherwise.
Simply, no, you should not define the
storageId property as we generate that value automatically.
If you have data in that field, and you change the property value, you will lose all the data in it.
For the existing definitions, prior to the v5.33.0, of the
CmsModelPlugin you MUST add the
storageId property to every field you have defined.
We create a
storageId automatically, but for your existing models you want to have the
storageId values set to the existing
So, for example, if you have a model defined:
You will need to add the
storageId property to each of the fields. Don’t forget the nested fields in the
object type field.
If you forget to do this after the upgrade to the v5.33.0, you will not get any data back from your queries.