It seems sub-optimal to me that a failed migration could leave a contract is a totally broken state and all we do as mitigation is warn people this might happen. I wonder if it makes sense to extend the upgrade plugin to include an optional string which is the name of the migration method. Then the promise produced by up_deploy_code could itself be a batch which includes both the deploy and the migration call. This would ensure that the migration and deploy are always atomic.
_Originally posted by @birchmd in https://github.com/aurora-is-near/near-plugins/pull/74#discussion_r1086796106_