CREATE TABLE `tbltenant_email_logs`(
    `id` BIGINT(20) NOT NULL AUTO_INCREMENT PRIMARY KEY,
    `tenant_id` BIGINT(20) UNSIGNED NOT NULL,
    `staff_id` BIGINT(20) UNSIGNED NULL,
    `to` MEDIUMTEXT NOT NULL,
    `message` TEXT NOT NULL,
    `subject` MEDIUMTEXT NULL,
    `ip_address` VARCHAR(200) NULL,
    `module` VARCHAR(200) NULL,
    `from` VARCHAR(200) NULL,
    `added_on` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
    FOREIGN KEY(`tenant_id`) REFERENCES tbltenants(`id`),
    FOREIGN KEY(`staff_id`) REFERENCES tblstaff(`staffid`)
) ENGINE = InnoDB;
