Hi. I convert database from sqlite to mysql. Then upload dump into database see error
Can’t create table seahub_db.post_office_attachment_emails (errno: 150 “Foreign key constraint is incorrectly formed”)
its my create table script:
CREATE TABLE IF NOT EXISTS
post_office_attachment_emails(
idinteger NOT NULL PRIMARY KEY AUTO_INCREMENT,
attachment_idinteger NOT NULL,
email_idinteger NOT NULL REFERENCESpost_office_email(id),
UNIQUE (attachment_id,email_id)) ENGINE=INNODB;
CREATE TABLE IF NOT EXISTS
post_office_email(
idinteger NOT NULL PRIMARY KEY AUTO_INCREMENT,
from_emailvarchar(254) NOT NULL,
totext NOT NULL,
cctext NOT NULL,
bcctext NOT NULL,
subjectvarchar(255) NOT NULL,
messagetext NOT NULL,
html_messagetext NOT NULL,
statussmallint unsigned,
prioritysmallint unsigned,
createddatetime NOT NULL,
last_updateddatetime NOT NULL,
scheduled_timedatetime,
headerstext,
template_idinteger,
contexttext,
backend_aliasvarchar(64) NOT NULL) ENGINE=INNODB
CREATE TABLE IF NOT EXISTS
post_office_attachment_emails(
idinteger NOT NULL PRIMARY KEY AUTO_INCREMENT,
attachment_idinteger NOT NULL,
email_idinteger NOT NULL REFERENCESpost_office_email(id),
UNIQUE (attachment_id,email_id)) ENGINE=INNODB;