禁用草稿和发布的内容类型,其 publishedAt 值总是设置为某个日期
🌐 Content types with Draft & Publish disabled always have the publishedAt value set to a date
在 Strapi 5 中,禁用“草稿和发布”的内容类型的 publishedAt 值总是会被设置为一个日期。
此页面是重大更改数据库的一部分,提供关于重大更改的信息以及从 Strapi v4 迁移到 Strapi 5 的附加说明。
🌐 This page is part of the breaking changes database and provides information about the breaking change and additional instructions to migrate from Strapi v4 to Strapi 5.
重大变更描述
🌐 Breaking change description
在 Strapi v4 中
在 Strapi v4 中,草稿与发布功能禁用的内容类型甚至没有 publishedAt 属性。
🌐 In Strapi v4, a content-type with Draft & Publish disabled does not even have a publishedAt attribute.
在 Strapi 5 中
在 Strapi 5 中,即使内容类型禁用了草稿与发布,publishedAt 属性也始终存在。
🌐 In Strapi 5, the publishedAt attribute always exist even if Draft & Publish is disabled for a content-types.
迁移
🌐 Migration
本节重新组合了有关引入的重大更改的有用说明和程序。
🌐 This section regroups useful notes and procedures about the introduced breaking change.
注意
🌐 Notes
- 如果启用草稿与发布,
publishedAt是:null用于文档的草稿版本- 并设置为已发布版本的文档的发布日期。
- 如果禁用草稿和发布,
publishedAt将设置为文档的最新创建或编辑日期。