Lost all content - what happened?

I originally posted this in the Questions and Answers forum but received no reply there.

This is the issue:

I needed to add author details to a news items content type I had created, so I edited the model as outlined here: Backend customization - Strapi Developer Documentation

I then merged the feature branch I was on into the dev branch and then checked out the dev branch.

I then got 403 errors from the Strapi API in my NextJS project - turns out the previously set permissions had been deleted. In addition to this all the content I had entered into Strapi has completely disappeared. What has caused this? This behaviour is obviously a big red flag for the project - can’t afford for this to happen once the project is live.

What database are you using and what where the exact changes you made?

Hi @Boegie19 I’m developing locally:

Strapi Version: 4.5.6
Operating System: MacOS 11.6
Database: PostgreSQL 15
Node Version: 16.13.1
NPM Version: 8.1.2

The change I made was adding "populateCreatorFields": true to options in my news item schema. I then tested this was working. It was, so I then merged the branch I was on into the develop branch and then checked out out the develop branch. Then I was receiving 403 errors from the requests made to my Strapi instance - this was caused by the permissions I had set (Find all, find one) had been removed. In addition to the permissions being removed all the content for all the collection types I had entered into the Content Manager was no longer there. The relevant tables in the PostgreSQL were empty.

@Boegie19 Any idea why this issue may have happened?

What changes you made exactly?

If you update the name of a field (e.g. from name to first_name) it deletes the old one and creates the new field (e.g. all names are gone and a field first_name is created but is empty)

As explained above, the change I made was adding "populateCreatorFields": true to options in my news item schema. I then merged the branch with this change into my dev branch and then checked out my dev branch. I was then just getting 403 errors from all the Strapi endpoints and I discovered that the previously set permissions and all the data for all my collections had been deleted.