CREATE TABLE AutomatedEmails
(
    Module BIGINT UNSIGNED NOT NULL,
    Zone BIGINT UNSIGNED NOT NULL,
    Field VARCHAR(255) NOT NULL,
    Email BIGINT UNSIGNED NOT NULL,
    PRIMARY KEY ( Module,Zone,Field ),
    FOREIGN KEY ( Zone ) REFERENCES Zone ( id) ON DELETE CASCADE ON UPDATE RESTRICT,
    FOREIGN KEY ( Email ) REFERENCES EmailMessage ( id) ON DELETE CASCADE ON UPDATE RESTRICT,
    FOREIGN KEY ( Module ) REFERENCES Module ( id) ON DELETE CASCADE ON UPDATE RESTRICT

) ENGINE=INNODB CHARSET=UTF8 COMMENT="Automatically send email when a node is created in the given";
