CREATE TABLE NewsletterQueueDataType
(
    id BIGINT DEFAULT NULL,
    Newsletter BIGINT UNSIGNED NOT NULL,
    Person BIGINT UNSIGNED NOT NULL,
    Status ENUM("QUEUE", "WORK", "SENT", "FAILED", "BOUNCE") DEFAULT "QUEUE",
    LockId CHAR(32) DEFAULT NULL,
    QueueTs BIGINT UNSIGNED NOT NULL,
    SendTs BIGINT UNSIGNED DEFAULT NULL,
    PRIMARY KEY ( id ) AUTO_INCREMENT,
    KEY Newsletter ( Newsletter,Person,QueueTs ),
    KEY ( LockId )

) ENGINE=INNODB CHARSET=UTF8;
