Modification of published content

System Information
  • Strapi Version: 4.0.0
  • Operating System: MacOS
  • Database: postgres
  • Node Version: 14.17.6
  • NPM Version:
  • Yarn Version: v1.22.17

Hi team, we have a requirement: we fetch data by ID, if user modify the published content, that item should be treated as new one. So we want to auto increase ID once user modify the published content. Does strapi suppport it?
Basically is there any unique field can be auto changed after the modification. Is there any field we can use to meet this use case? Any help would be much appreciated.

Why would you want to increase the ID?

You could autoincrease a version (integer) attribute or just work with a datetime-Attribute if the updated_at isn’t enough for your UseCase.

In my opinion, manipulating the ID should not be considered as a solution.
If you want to create a new entity you could however also create a solution by using beforeUpdate-Lifecycle-Hook and create a new (copied) entity that will - by default - get a new ID.

So I guess it’s not a question “if strapi does support it” more like how flexible you are.

1 Like