code: def _lazy_migration(self, patch=None, meta=None, toa=None):
          
          objects = yield self.revisions.find({"master_id": self.master_id}, limit=1)
  
          if len(objects) > 0:
              raise Return(objects)
  
          if not patch:
              patch = yield self.collection.find_one_by_id(self.master_id)
  
          if not toa:
               toa = long(time.mktime(datetime.datetime.now().timetuple()))
  
          meta["comment"] = "This document was migrated automatically."
  
          if isinstance(patch, dict) and patch.get("id"):
              del patch["id"]
  
          if isinstance(patch, dict) and patch.get("_id"):
              del patch["_id"]
  
          #Here we separate patch and snapshot, and make sure that the snapshot looks like the master document
          snapshot = copy.deepcopy(patch)
          snapshot["id"] = self.master_id
          snapshot["published"] = self.settings.get("scheduler", {}).get("lazy_migrated_published_by_default", False)
  
          #If no objects are returned, this is some legacy object that needs a first revision
          #Create it here
          legacy_revision = {
              "toa": toa,
              "processed": True,
              "collection": self.collection_name,
              "master_id": self.master_id,
              "action": self.INSERT_ACTION,
              "patch": self.collection._dictionary_to_cursor(patch),
              "snapshot": snapshot,
              "meta": meta,
          }
  
          response = yield self.revisions.insert(legacy_revision)
          if isinstance(response, str):
              raise Return([legacy_revision])
  
          raise Return(None)
docs: Handle when a revision scheduling is turned onto a collection that was previously not scheduleable.
          This method will create the first revision for each object before its every used in the context of scheduling.
  
          :param dict patch: The patch that should be used
          :param dict meta: Meta data for this action
          :param int toa: The time of action
          :return: A legacy revision for a document that was previously
          :rtype: list