CREATE TABLE IF NOT EXISTS `EmailSync`
(
    `id`         INT(11)       NOT NULL AUTO_INCREMENT,
    `account`    VARCHAR(64)   NOT NULL DEFAULT '',
    `folderPath` VARCHAR(128)  NOT NULL DEFAULT '',
    `messageId`  VARCHAR(255)  NOT NULL DEFAULT '',
    `sender`     VARCHAR(128)  NOT NULL DEFAULT '',
    `receiver`   VARCHAR(2048) NOT NULL DEFAULT '',
    `cc`         VARCHAR(2048) NOT NULL DEFAULT '',
    `subject`    VARCHAR(1024) NOT NULL DEFAULT '',
    `bodyText`   TEXT          NOT NULL DEFAULT '',
    `bodyHtml`   TEXT          NOT NULL DEFAULT '',
    `attachment` VARCHAR(4096) NOT NULL DEFAULT '',
    `header`     TEXT          NOT NULL DEFAULT '',
    `flags`      VARCHAR(2048) NOT NULL DEFAULT '',
    `created`    DATETIME      NOT NULL DEFAULT current_timestamp(),
    `modified`   DATETIME      NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
    PRIMARY KEY (`id`),
    KEY `accountFolderPathMessageId` (`account`, `folderPath`, `messageId`) USING BTREE,
    KEY `messageId` (`messageId`) USING BTREE
) ENGINE = InnoDB
  DEFAULT CHARSET = utf8mb4
  AUTO_INCREMENT = 0;
