Jorge Bastos wrote: > Ok, > I rechecked all tables against "create_tables.*" file, and all are updated. > I had a lot without foreign keys (ouch), hopefully I never had any problems, > maybe because if the nightly dbmail-util? > I just faced one difference in the structure of one table, > dbmail_sievescripts, I have the table with these fields sinse it was created > in 2.0.x. > > My table: > CREATE TABLE `dbmail_sievescripts` ( > `id` bigint(20) NOT NULL auto_increment, > `owner_idnr` bigint(20) NOT NULL default '0', > `active` tinyint(1) NOT NULL default '0', > `name` varchar(100) NOT NULL, > `script` text NOT NULL, > PRIMARY KEY (`id`), > KEY `dbmail_sievescripts_1` (`owner_idnr`,`name`), > KEY `dbmail_sievescripts_2` (`owner_idnr`,`active`), > CONSTRAINT `dbmail_sievescripts_ibfk_1` FOREIGN KEY (`owner_idnr`) > REFERENCES `dbmail_users` (`user_idnr`) ON DELETE CASCADE ON UPDATE CASCADE > ) ENGINE=InnoDB AUTO_INCREMENT=346 DEFAULT CHARSET=utf8 > > > Create_table.* file: > CREATE TABLE dbmail_sievescripts ( > owner_idnr bigint(21) DEFAULT '0' NOT NULL, > name varchar(100) NOT NULL, > script text, > active tinyint(1) default '0' not null, > INDEX (name), > INDEX (owner_idnr), > UNIQUE INDEX (owner_idnr, name), > FOREIGN KEY owner_idnr_fk (owner_idnr) > REFERENCES dbmail_users (user_idnr) ON DELETE CASCADE ON UPDATE CASCADE > ) ENGINE=InnoDB DEFAULT CHARSET=utf8; > > > So, I have a plus field that is "id", can I remove this field, or is the > create_table.* file that is missing this field?
You can remove that field. But please pay attention to the keys. In the vanilla dbmail sievescripts table there is a UNIQUE INDEX (owner_idnr, name) that is *not* there in your schema. -- ________________________________________________________________ Paul Stevens paul at nfg.nl NET FACILITIES GROUP GPG/PGP: 1024D/11F8CD31 The Netherlands________________________________http://www.nfg.nl _______________________________________________ DBmail mailing list [email protected] https://mailman.fastxs.nl/mailman/listinfo/dbmail
