Hi!
Is there a way to manage the content model in code alone? Migration scripts seem to be an ok alternative that i’m currently looking into, but somehow it seems to consume a bit more work to what i’m looking for.
The way i’m looking for to work with would be that you would define the content model in the code like:
“displayField”: “name”,
“name”: “Card Header”,
“description”: “Header Card”,
“fields”: [
{
“id”: “name”,
“name”: “Name”,
“type”: “Symbol”,
“localized”: false,
“required”: true,
“validations”: [
],
“disabled”: false,
“omitted”: false
},
{
“id”: “headerText”,
“name”: “Header Text”,
“type”: “Symbol”,
“localized”: true,
“required”: true,
“validations”: [
],
“disabled”: false,
“omitted”: false
},
{
“id”: “headerIcon”,
“name”: “Header Icon”,
“type”: “Link”,
“localized”: false,
“required”: true,
“validations”: [
],
“disabled”: false,
“omitted”: false,
“linkType”: “Asset”
}
]
And if you have some changes to the content model you would simply make the changes to what you have defined and commit the changes? Pushing the information to the environment would make the necessary changes?
In addition, It seems that since we don’t have the migration scripts in place at the moment - changes have been done both in master and dev environments using the contentful ui, which is not good of course. I’m planning on exporting the info from master and dev check the differences in the export and combining them and importing this combined json to both dev and master. Will this work or would there be a better solution to fix this? Master env changes have only done to the description field of the content model.
How does the export and import work? Does it simply update and create the content models in brute force or is there something else we would need to account for?
Thank you in advance!