code: func EnsurePlatforms(c context.Context, cfgs []*config.Platform) (map[string]int64, error) {
  	t := &PlatformsTable{}
  	if err := t.fetch(c); err != nil {
  		return nil, errors.Annotate(err, "failed to fetch platforms").Err()
  	}
  	t.computeChanges(c, cfgs)
  	if err := t.add(c); err != nil {
  		return nil, errors.Annotate(err, "failed to add platforms").Err()
  	}
  	if err := t.remove(c); err != nil {
  		return nil, errors.Annotate(err, "failed to remove platforms").Err()
  	}
  	if err := t.update(c); err != nil {
  		return nil, errors.Annotate(err, "failed to update platforms").Err()
  	}
  	return t.ids(c), nil
  }
docs: // EnsurePlatforms ensures the database contains exactly the given platforms.
  // Returns a map of platform names to IDs.