How do I create additional fields in module.install? I am creating a module in the ".install" file, using the following code:

// if not exists, create new content type
if (!node_get_types('type', 'houses')) {
  $info = array(
    'type' =&gt; 'houses',
    'name' =&gt; t('Houses'),
    'module' =&gt; 'node',
    'description' =&gt; t('Manager Houses'),
    'locked' =&gt; FALSE,
    'custom' =&gt; TRUE,
  );
  $info = _node_type_set_defaults($info);
  node_type_save((object)$info);
}


It creates a new content type, but how do I create additional fields (e.g. text, nodereference)?
Instead of creating the node type and fields by hand in code, you should use the features module which does the same thing, but has support for a bunch of other things as well, like reverting changes made to what is saved in code.