If you have a server with an API and you need to run a migration for parts of the data do you:
- write a script and call the API of the server?
- code the migration into the server so it runs e.g. on server start or on a specific API call?
Conclusion for now: If it's something more involved, do it inside of the server. The API might be lacking functionalities, leading to roadblocks. Not something you'd want.