code: def migration(resource, version, previous_version=''):
      
      def decorator(func):
          @wraps(func)
          def wrapper(*args, **kwargs):
              migrated = func(*args, **kwargs)
  
              return migrated
  
          m = Migration(wrapper, resource, version, previous_version)
          m.register()
  
          return m
  
      return decorator
docs: Register a migration function