Warning at enabling module - Can't create tables

jmary - July 21, 2008 - 15:27
Project:MailServer
Version:5.x-1.0-beta
Component:Code
Category:bug report
Priority:critical
Assigned:jmary
Status:patch (to be ported)
Description

* user warning: Can't create table './example/mail_mailserver_virtual_users.frm' (errno: 150) query: CREATE TABLE mail_mailserver_virtual_users ( id INT(11) NOT NULL AUTO_INCREMENT PRIMARY KEY, domain_id INT(11) NOT NULL, user VARCHAR(40) NOT NULL, password VARCHAR(32) NOT NULL, CONSTRAINT UNIQUE_EMAIL UNIQUE (domain_id, user), FOREIGN KEY (domain_id) REFERENCES mailserver_virtual_domains(id) ON DELETE CASCADE ) ENGINE = InnoDB /*!40100 DEFAULT CHARACTER SET utf8 */; in /var/www/vhosts/example.com/includes/database.mysql.inc on line 172.
* user warning: Can't create table './example/mail_mailserver_virtual_aliases.frm' (errno: 150) query: CREATE TABLE mail_mailserver_virtual_aliases ( id INT(11) NOT NULL AUTO_INCREMENT PRIMARY KEY, domain_id INT(11) NOT NULL, source VARCHAR(40) NOT NULL, destination VARCHAR(80) NOT NULL, FOREIGN KEY (domain_id) REFERENCES mailserver_virtual_domains(id) ON DELETE CASCADE ) ENGINE = InnoDB /*!40100 DEFAULT CHARACTER SET utf8 */; in /var/www/vhosts/example.com/includes/database.mysql.inc on line 172.

#1

jmary - July 21, 2008 - 15:54

This is a mistake in the SQL request : The prefix mail_ which I set up at installing drupal is not considered in the reference of the foreign key.
It should be :

CREATE TABLE mail_mailserver_virtual_users ( id INT(11) NOT NULL AUTO_INCREMENT PRIMARY KEY, domain_id INT(11) NOT NULL, user VARCHAR(40) NOT NULL, password VARCHAR(32) NOT NULL, CONSTRAINT UNIQUE_EMAIL UNIQUE (domain_id, user), FOREIGN KEY (domain_id) REFERENCES mail_mailserver_virtual_domains(id) ON DELETE CASCADE ) ENGINE = InnoDB

and

CREATE TABLE mail_mailserver_virtual_aliases ( id INT(11) NOT NULL AUTO_INCREMENT PRIMARY KEY, domain_id INT(11) NOT NULL, source VARCHAR(40) NOT NULL, destination VARCHAR(80) NOT NULL, FOREIGN KEY (domain_id) REFERENCES mail_mailserver_virtual_domains(id) ON DELETE CASCADE ) ENGINE = InnoDB

#2

jmary - July 21, 2008 - 16:03

The answer above doesn't fix the issue :

The system then expect to find the tables without the prefix mail_ when adding a domain.

#3

jmary - July 21, 2008 - 20:59
Assigned to:Anonymous» jmary
Status:active» patch (to be ported)

This patch solves the problem of the non inserted prefix when referencing the table :

prefix_mailserver_virtual_domains

at creating the tables :

mail_mailserver_virtual_users and mail_mailserver_virtual_aliases.

========

This is solving one issue, we have another one then when we want to add a domain.

AttachmentSize
mailserver.install.patch 867 bytes
 
 

Drupal is a registered trademark of Dries Buytaert.