code: def create(resource_path, previous_version=None, package='perch.migrations'):
      
      pkg, obj = resource_path.rsplit('.', 1)
      module = importlib.import_module(pkg)
      resource = getattr(module, obj)
      version = uuid4().hex
      target_module = importlib.import_module(package)
      target_dir = os.path.dirname(target_module.__file__)
      target_file = os.path.join(target_dir, resource.resource_type + '_' + version + '.py')
  
      with open(target_file, 'w') as f:
          f.write(MIGRATION_TEMPLATE.format(
              resource_path=resource_path,
              resource_type=resource.resource_type,
              version=version,
              previous_version=previous_version or '',
          ))
  
      return target_file
docs: Create a new migration