is there a way to add a field to a global set by code ? I figured out how to create a global:
$global = new GlobalSetModel();
$global->name = 'GlobalName';
$global->handle = 'globalHandle';
craft()->globals->saveSet($global)
But I can't figure out how to add a field to this newly create global.