 
 CREATE TABLE #__tool_version_hostreq ( 
 	tool_version_id	int(11) NOT NULL,
-	hostreq        	varchar(255) NOT NULL 
+	hostreq        	varchar(255) NOT NULL,
+	UNIQUE KEY `toolid` (`tool_version_id`,`hostreq`)
 ) TYPE=MyISAM CHARACTER SET `utf8`;
 
 CREATE TABLE #__tool_version_middleware ( 
 	tool_version_id	int(11) NOT NULL,
-	middleware     	varchar(255) NOT NULL 
+	middleware     	varchar(255) NOT NULL,
+	UNIQUE KEY `toolid` (`tool_version_id`,`middleware`)
 ) TYPE=MyISAM CHARACTER SET `utf8`;
 
 CREATE TABLE #__tool_version_tracperm ( 
 	tool_version_id	int(11) NOT NULL,
-	tracperm       	varchar(64) NOT NULL 
+	tracperm       	varchar(64) NOT NULL, 
+	UNIQUE KEY `toolid` (`tool_version_id`,`tracperm`)
 ) TYPE=MyISAM CHARACTER SET `utf8`;
 
 # --------------------------------------------------------

  KEY `mid` (`mid`),
  KEY `uid` (`uid`)
) TYPE=MyISAM CHARACTER SET `utf8`;

	state      	int(3) NOT NULL DEFAULT '0',
	public     	int(3) NOT NULL DEFAULT '1',
	description	varchar(255) NULL,
	type		int(11) NULL DEFAULT '0',
	PRIMARY KEY(id)
) TYPE=MyISAM CHARACTER SET `utf8`;

