Disable/Enable module results in error

Migrated issue

Reported by: jhodgdon

If you disable and then immediately re-enable the API module, the hook_enable() code gives you this error:

User warning: Duplicate entry 'php-php' for key 'project_name' query: INSERT INTO api_branch (branch_name, project, type, data, status, title, project_title, weight) VALUES ('php', 'php', 'php', 'a:2:{s:7:\"summary\";s:67:\"http://svn.php.net/repository/phpdoc/doc-base/trunk/funcsummary.txt\";s:4:\"path\";s:24:\"http://php.net/!function\";}', 0, 'PHP functions', 'php', 0) in _db_query() (line 134 of /opt/www/apisite/includes/database.mysqli.inc).