Author Topic: nightly-20070318 : constraint violation Query: ... in rcube_db.inc on line 503  (Read 5054 times)

Offline juliens

  • Newbie
  • *
  • Posts: 4
Hello,

I've just upgraded to nightly-20070318 and everything is working fine except each time I switch folder, I got messages like the one below for each message in folder in logs\error file.

DB Error: DB Error: constraint violation Query: INSERT INTO messages (user_id, del, cache_key, created, idx, uid, subject, `from`, `to`, cc, date, size, headers, structure) VALUES (....) in /home/local/apache/htdocs/sites/.../mail/program/include/rcube_db.inc on line 503

Any idea on the cause and how to fix that ?

Offline juliens

  • Newbie
  • *
  • Posts: 4
Problem solved by dropping table messages and recreating it with

CREATE TABLE `messages` (
 `message_id` int(11) unsigned NOT NULL auto_increment,
 `user_id` int(11) unsigned NOT NULL default '0',
 `del` tinyint(1) NOT NULL default '0',
 `cache_key` varchar(128) NOT NULL default '',
 `created` datetime NOT NULL default '0000-00-00 00:00:00',
 `idx` int(11) unsigned NOT NULL default '0',
 `uid` int(11) unsigned NOT NULL default '0',
 `subject` varchar(255) NOT NULL default '',
 `from` varchar(255) NOT NULL default '',
 `to` varchar(255) NOT NULL default '',
 `cc` varchar(255) NOT NULL default '',
 `date` datetime NOT NULL default '0000-00-00 00:00:00',
 `size` int(11) unsigned NOT NULL default '0',
 `headers` text NOT NULL,
 `structure` text,
 PRIMARY KEY (`message_id`),
 KEY `user_id` (`user_id`),
 KEY `idx` (`idx`),
 KEY `uid` (`uid`),
 UNIQUE `uniqueness` (`user_id`, `cache_key`, `uid`)
);