code: func (e *Empire) SetMaintenanceMode(ctx context.Context, opts SetMaintenanceModeOpts) error {
  	if err := opts.Validate(e); err != nil {
  		return err
  	}
  
  	tx := e.db.Begin()
  
  	app := opts.App
  
  	app.Maintenance = opts.Maintenance
  
  	if err := appsUpdate(tx, app); err != nil {
  		tx.Rollback()
  		return err
  	}
  
  	if err := e.releases.ReleaseApp(ctx, tx, app, nil); err != nil {
  		tx.Rollback()
  		if err == ErrNoReleases {
  			return nil
  		}
  
  		return err
  	}
  
  	if err := tx.Commit().Error; err != nil {
  		return err
  	}
  
  	return e.PublishEvent(opts.Event())
  }
docs: // SetMaintenanceMode enables or disables "maintenance mode" on the app. When an
  // app is in maintenance mode, all processes will be scaled down to 0. When
  // taken out of maintenance mode, all processes will be scaled up back to their
  // existing values.