This upgrade requires Strapi v5 and is NOT compatible with Strapi v4.
The only breaking change in this version is the plugin configuration has moved from the root-level config/plugins.ts
to now apply to each content-type's pluginOptions
defined in schema.json
.
Previously, configuring delete rules was applied in the root-level config/plugins.ts
.
// ./config/plugins.ts`
export default () => ({
'do-not-delete': {
config: {
contentTypes: {
'api::page.page': [
['slug', 'is', 'home'],
],
},
},
},
});
Going forward, the same configuration will need to be applied to each content-type's pluginOptions
prop.
// ./api/page/content-types/page/schema.json
{
"kind": "collectionType",
"collectionName": "pages",
"info": {
"singularName": "page",
"pluralName": "pages",
"displayName": "Page",
"description": "Generic web page"
},
"options": {
"draftAndPublish": true
},
"pluginOptions": {
"do-not-delete": {
"rules": [
["slug", "is", "home"]
]
}
},
"attributes": {
"title": {
"type": "string",
"required": true
},
"slug": {
"type": "uid",
"targetField": "title",
"required": true
}
}
}