Provisioning seed data after removeAll()

I’m working with External Types pointing on a Sql DB.
I was having conflicts between old and new SqlSourceCollection instances (coming from .json files inside the seed/ folder of a package) so I removed all of them with the console command: SqlSourceCollection.removeAll()
The goal was to reset the status on the platform and build back from scratch with a new provisioning, bringing back only the last version of the SqlSourceCollection seed data defined through .json files in the package.

The problem is that after the provisioning (with or without reset) the previously removed SqlSourceCollection objects are not coming back (SqlSourceCollection.fetch() give “no content”).
Probably the objects I removed are still saved somewhere and conflict with the new seed data coming from the provisioning.
How can I provision again the seed data avoiding conflicts with the old ones previously removed?

@Nicola please give a try running this command from console

SeedData.clearCache()

then provision again with Reset option - in general when you have to delete SeedData it is better to use the API

SeedData.removeSeedData()
1 Like

Thank you Marco.
With SqlSourceCollection.cleanCache() I was not able to load the seed data with a provisioning+reset.
On the other hand with SqlSourceCollection.removeSeedData() I was able to delete the instances in a clean way and reload them through a provisioning+reset without conflicts.

@Nicola This is the expected behavior with SeedData. The assumption is that anything that is done manually (e.g. update/remove) is a “user change” that is to be preserved even if the obj is reprovisioned.

You can .fetch({ fetchHiddenSeedData: true })) to find the seed data instances you have removed