code: def run_migrations(migrations):
      
      for resource, resource_migrations in migrations.items():
          for version in resource_migrations:
              to_migrate = yield resource_version.get(
                  key=[resource.resource_type, version],
                  include_docs=True)
  
              for x in to_migrate['rows']:
                  instance = resource(**x['doc'])
                  instance = _migrate_resource(
                      instance,
                      resource_migrations,
                      version
                  )
  
                  yield instance._save()
docs: Run migrations for a resource type
  
      :param: a dicitionary of migrations