code: func (m *GormCodebaseRepository) Create(ctx context.Context, codebase *Codebase) error {
  	defer goa.MeasureSince([]string{"goa", "db", "codebase", "create"}, time.Now())
  	if codebase.ID == uuid.Nil {
  		codebase.ID = uuid.NewV4()
  	}
  
  	if err := m.db.Create(codebase).Error; err != nil {
  		// if codebase already exists in the space
  		if gormsupport.IsUniqueViolation(err, "codebases_spaceid_url_idx") {
  			log.Error(ctx, map[string]interface{}{
  				"err":      err,
  				"URL":      codebase.URL,
  				"space_id": codebase.SpaceID,
  			},
  				"unable to create codebase because the codebase with same URL already exists in space")
  			errStr := fmt.Sprintf("codebase already exists with URL = %s, space_id = %s",
  				codebase.URL, codebase.SpaceID)
  			return errors.NewDataConflictError(errStr)
  		}
  		goa.LogError(ctx, "error adding Codebase", "error", err.Error())
  		return errs.WithStack(err)
  	}
  
  	return nil
  }
docs: // Create creates a new record.