> > Im handling things to upgrade to the latest GIT on the production
> (Ive
> > been testing on other machine),
> 
> Please stay with a revision you have actually tested and trust. Never
> simply follow git-head on any production system.

Yes Paul, but, the last fixes you did are very handy for me,
I'll wait a few more days and do a backup & test before put it production.

> > but, when I add the UNIQUE INDEX that is
> > on the sql upgrade file, I get this:
> >
> > mysql> CREATE UNIQUE INDEX dbmail_envelope_1 ON
> > dbmail_envelope(physmessage_id);
> >
> > ERROR 1062 (23000): Duplicate entry '294904' for key 3
> >
> > mysql>
> >
> > How can I pass this without damaging my db?
> >

> Apparently you already have a unique index on dbmail_envelope.physmessage_id. 
> So comment out or remove the statement involved.

This is how it is right now:

CREATE TABLE `dbmail_envelope` (
  `physmessage_id` bigint(20) NOT NULL default '0',
  `id` bigint(20) NOT NULL auto_increment,
  `envelope` text NOT NULL,
  PRIMARY KEY  (`id`),
  UNIQUE KEY `physmessage_id` (`physmessage_id`,`id`),
  KEY `physmessage_idx` (`physmessage_id`),
  CONSTRAINT `dbmail_envelope_ibfk_1` FOREIGN KEY (`physmessage_id`) REFERENCES 
`dbmail_physmessage` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=3843297 DEFAULT CHARSET=utf8


The create_tables.sql has:

CREATE TABLE `dbmail_envelope` (
  `id` bigint(20) NOT NULL auto_increment,
  `physmessage_id` bigint(20) NOT NULL default '0',
  `envelope` text NOT NULL,
  PRIMARY KEY  (`id`),
  UNIQUE KEY `physmessage_id_1` (`physmessage_id`),
  UNIQUE KEY `physmessage_id_2` (`physmessage_id`,`id`),
  CONSTRAINT `dbmail_envelope_ibfk_1` FOREIGN KEY (`physmessage_id`) REFERENCES
`dbmail_physmessage` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

But if I'm not wrong, it'll never be possible to have a unique key for 
"physmessage_id_2" with the field "physmessage_id" repeated on the unique 
"physmessage_id_1".

Am I right? Ex:

1,1,j...@domain.pt
2,2,ma...@domain.pt
3,2,jo...@domain.pt <= it won't be possible 'cause there's an UNIQUE key on 
field "physmessage_id".





_______________________________________________
Dbmail-dev mailing list
Dbmail-dev@dbmail.org
http://mailman.fastxs.nl/cgi-bin/mailman/listinfo/dbmail-dev

Reply via email to