code: func (tl TypeLoader) LoadForeignKeys(args *ArgType, tableMap map[string]*Type) (map[string]*ForeignKey, error) {
  	var err error
  
  	fkMap := map[string]*ForeignKey{}
  	for _, t := range tableMap {
  		// load keys per table
  		err = tl.LoadTableForeignKeys(args, tableMap, t, fkMap)
  		if err != nil {
  			return nil, err
  		}
  	}
  
  	// determine foreign key names
  	for _, fk := range fkMap {
  		fk.Name = args.ForeignKeyName(fkMap, fk)
  	}
  
  	// generate templates
  	for _, fk := range fkMap {
  		err = args.ExecuteTemplate(ForeignKeyTemplate, fk.Type.Name, fk.ForeignKey.ForeignKeyName, fk)
  		if err != nil {
  			return nil, err
  		}
  	}
  
  	return fkMap, nil
  }
docs: // LoadForeignKeys loads foreign keys.