How do I execute code when a module is installed or uninstalled?
Needs to go inside of mymodule.install file

&lt;?php

/*
 * Implements hook_install()
 */
function mymodule_install() {

  // code that creates terms

}

/*
 * Implements hook_uninstall()
 */
function mymodule_uninstall() {

  // code that deletes terms

}