Hei,
we are using defined schemas, migrations and cloud code. One issue we are currently run into is that the migrations (defined in afterMigration
) also trigger any defined triggers in cloud code (e.g. beforeSave
). As some of the logic in the triggers is only valid during runtime and normal requests, we would like to skip triggers for changes performed in migrations. Each migration step would need to ensure necessary logic and cannot rely on trigger logic.
We digged through the code and were able to register cloud code later in the serverStartComplete
method which is executed after migrations, instead of directly registering all cloud methods via the cloud
option.
Is that a valid option, are there downsides (security wise)? Of course, the cloud functions would be available later - after the migrations are done, but that’s ok for us. Do you see other options on how to disable triggers for migration changes? With our setup, we cannot skip triggers for master key requests.