Changing ids of items in integration fields data

Hi!

We are using the integration fields a lot in our Prismic setup. We use the variant where Prismic pulls the data from our API.

We are currently in the process of migrating part of our service from a MongoDB backed app to a PostgreSQL backed app. Included in this migration is the endpoint that handles one of our integration fields. We unfortunately used the MongoDB _id as id in the return value from the integration field endpoint at our side. I'm assuming that you use the id for deciding what's a new "item" and what already exists. If not, how do you do it?

The new endpoint has the exact same data, but with different ids. I'm guessing what will happen is that we would get duplicate items, one with the old MongoDB id and one with the new id. Or will the items on the Prismic side that has ids that's no longer available on our side be removed? If that's the case, what will happen with all the associations we have from our pages to the integration field items?

I really want to

  • Not have to import the old MongoDB ids to our new DB
  • Not have to go through everywhere we use the items from the integration fields and update them.

Does anyone have any idea how to solve this? Or am I missing something?

Regards
Patrik Stenmark

Hi @patrik,

If you change your Integration Fields catalog, existing documents will not change. (As a general principle: When you change a model in Prismic, it doesn't affect documents until you edit them manually. This helps ensure that small accidental changes don't have major effects.)

So, you can change your catalog without affecting your documents. However, the next time you edit each document, you will need to reselect a new Integration Field item for it. Otherwise, when you publish changes to the document, the Integration Field for that document will disappear (because the old data for the field will now be invalid).

Does that help?

Sam