Moin moin!
ich habe da ein kleines Problem mit einem Script...
in der Tabelle Contentcollections werden Gruppen und Artikel abgespeichert bzw. eine Art Referenz
Artikel werden in der Tabelle contents abgespeichert
und Gruppen in der Tabelle
ich kann jetzt z.B. Gruppen erstellen oder Artikel schreiben über das Frontend...
was aber das Problem ist! Sobald ein Artikel in der Tabelle Contentcollections eingetragen wird kann ich keine weiteren Gruppen anlegen! Man kann ab dann nur noch Artikel zu der Tabelle hinzufügen...
und es erscheint immer die Fehlermeldung:
und das kapiere ich eben nicht denn der PRIMARY Key wird ja hoch gezählt wenn nur Gruppen angelegt werden oder nur Artikel geschrieben werden...
Für jede Hilfe bin ich mehr als dankbar!!!
Gruß Michael
ich habe da ein kleines Problem mit einem Script...
in der Tabelle Contentcollections werden Gruppen und Artikel abgespeichert bzw. eine Art Referenz
Code:
CREATE TABLE IF NOT EXISTS `contentcollections` ( `collection_id` int(11) NOT NULL DEFAULT '0', `type` int(2) NOT NULL DEFAULT '0', `title` varchar(255) NOT NULL DEFAULT '', `author_id` int(11) NOT NULL DEFAULT '0', `description` longtext, `is_active` tinyint(1) NOT NULL DEFAULT '0', `created` int(11) NOT NULL DEFAULT '0', `changed` int(11) NOT NULL DEFAULT '0', `picture` text, PRIMARY KEY (`collection_id`), KEY `is_active` (`is_active`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8;
Code:
CREATE TABLE IF NOT EXISTS `contents` ( `content_id` int(11) NOT NULL DEFAULT '0', `author_id` int(11) NOT NULL DEFAULT '0', `type` int(2) NOT NULL DEFAULT '0', `title` varchar(255) NOT NULL DEFAULT '', `is_active` tinyint(1) NOT NULL DEFAULT '0', `body` longtext NOT NULL, `allow_comments` tinyint(1) NOT NULL DEFAULT '0', `collection_id` int(11) NOT NULL DEFAULT '0', `created` int(11) NOT NULL DEFAULT '0', `changed` int(11) NOT NULL DEFAULT '0', `trackbacks` text, `display_on` tinyint(1) DEFAULT '0', `is_html` tinyint(1) DEFAULT '1', PRIMARY KEY (`content_id`), KEY `homepage_content` (`is_active`,`display_on`,`collection_id`,`created`), KEY `homepage_typed_content` (`is_active`,`display_on`,`collection_id`,`type`,`created`), KEY `user_content` (`is_active`,`collection_id`,`author_id`,`created`), KEY `user_typed_content` (`is_active`,`collection_id`,`author_id`,`type`,`created`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8;
Code:
CREATE TABLE IF NOT EXISTS `groups` ( `group_id` int(11) NOT NULL DEFAULT '0', `access_type` tinyint(1) NOT NULL DEFAULT '0', `reg_type` int(2) NOT NULL DEFAULT '0', `is_moderated` tinyint(1) NOT NULL DEFAULT '0', `category_id` int(11) NOT NULL DEFAULT '0', `header_image` text, `header_image_action` int(2) DEFAULT NULL, `display_header_image` varchar(40) DEFAULT '1', `extra` text, `group_type` varchar(64) NOT NULL DEFAULT 'regular', PRIMARY KEY (`group_id`), KEY `category_id` (`category_id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8;
was aber das Problem ist! Sobald ein Artikel in der Tabelle Contentcollections eingetragen wird kann ich keine weiteren Gruppen anlegen! Man kann ab dann nur noch Artikel zu der Tabelle hinzufügen...
und es erscheint immer die Fehlermeldung:
Code:
INSERT INTO `c1CS002`.`contentcollections` (collection_id, author_id, type, title, description, is_active, created, changed, picture) VALUES (1, 1, 1, 'Group Name', 'Group Description', 1, 1412676070, 1412676070, '') [nativecode=1062 ** Duplicate entry '1' for key 'PRIMARY']
Für jede Hilfe bin ich mehr als dankbar!!!
Gruß Michael
Kommentar