Could use a better function name here since it now also handles updates. `set_migration_state()` would be the natural choice,