Install-Tool hat Probleme mit Composite Primary Key
	
	
		Hallo zusammen,
es schaut so aus, als ob Contao Probleme mit folgendem SQL Statement hat:
	PHP-Code:
	
-- Portfolio2Categories
CREATE TABLE `tl_portfolio2cats` (
  `pid_portfolio` int(10) unsigned NOT NULL,
  `pid_portfolio_cats` int(10) unsigned NOT NULL,
  PRIMARY KEY  (`pid_portfolio`, `pid_portfolio_cats`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8; 
 Es wird zwar die Tabelle erfolgreich angelegt, aber anschliessend (die install.php wird neugeladen) meldet das Install-Tool, die Datenbank sei nicht mehr aktuell und möchte u.a. folgende Aktion durchführen:
	PHP-Code:
	
ALTER TABLE `tl_portfolio2cats` DROP INDEX `pid_portfolio`, ADD PRIMARY KEY  (`pid_portfolio`, `pid_portfolio_cats`); 
 :eek:
Diese Aktualisierung wiederum führt zu folgendem Fatal Error:
	PHP-Code:
	
Fatal error: Uncaught exception Exception  with message Query error: Can't DROP 'pid_portfolio'; check that column/key exists (ALTER TABLE `tl_portfolio2cats` DROP INDEX `pid_portfolio`, ADD PRIMARY KEY (`pid_portfolio`, `pid_portfolio_cats`);) thrown in C:\xampp\htdocs\myfolder\system\libraries\Database.php  on line 642 
 
Die komplette database.sql lautet:
	PHP-Code:
	
-- 
-- Table `tl_portfolio`
-- 
CREATE TABLE `tl_portfolio` (
  `id` int(10) unsigned NOT NULL auto_increment,
  `pid` int(10) unsigned NOT NULL default '0',
  `sorting` int(10) unsigned NOT NULL default '0',
  `tstamp` int(10) unsigned NOT NULL default '0',
  `title` varchar(255) NOT NULL default '',
  `industry` varchar(255) NOT NULL default '',
  `description` varchar(255) NOT NULL default '',
  `categories` text NULL,
  `info` text NULL,
  `image` text NULL,
  `tags` varchar(255) NOT NULL default '',
  `thumb` varchar(255) NOT NULL default '',
  PRIMARY KEY  (`id`),
  KEY `pid` (`pid`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
-- Categories
CREATE TABLE `tl_portfolio_cats` (
  `id` int(10) unsigned NOT NULL auto_increment,
  `title` varchar(255) NOT NULL default '',
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
-- Portfolio2Categories
CREATE TABLE `tl_portfolio2cats` (
  `pid_portfolio` int(10) unsigned NOT NULL,
  `pid_portfolio_cats` int(10) unsigned NOT NULL,
  PRIMARY KEY  (`pid_portfolio`, `pid_portfolio_cats`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8; 
 Wobei ohne der dritten Tabelle alles funktioniert. Eventuell kann jemand bei sich mal probieren... Ich komme nicht mehr weiter, brauche die Tabelle aber unbedingt :D
Beste Grüsse,
sans