CREATE TABLE NotificationContactAttempt__Tracking
(
    id BIGINT UNSIGNED NOT NULL AUTO_INCREMENT COMMENT "Unique identifier of contact attempt",
    ZoneId BIGINT UNSIGNED NOT NULL COMMENT "Identity of client that bought or used this contact attempt",
    NotifyCallId BIGINT UNSIGNED DEFAULT NULL COMMENT "Id of the NotifyCall associated to the attempt ( e.g. NotifyCall id )",
    LaunchId BIGINT UNSIGNED DEFAULT NULL COMMENT "Id of the launch that consumed the attempt",
    Method ENUM("Phone", "SMS", "Email") DEFAULT NULL COMMENT "Communication method associated with the attempt",
    BillingItemId BIGINT UNSIGNED DEFAULT NULL COMMENT "Id of the billing item associated to this contact attempt. This will be NULL if attempt was made after all prepaid blocks have been used or expired",
    ExpirationTimestamp BIGINT UNSIGNED DEFAULT NULL COMMENT "Timestamp after which the pre-paid attempt cannot be consumed anymore",
    AttemptTimestamp BIGINT UNSIGNED DEFAULT NULL COMMENT "Timestamp of the moment at which the attempt was made",
    IsSupplementary TINYINT UNSIGNED DEFAULT 0 COMMENT "Indication if the attempt is pre-paid or supplementary",
    LockId CHAR(32) DEFAULT NULL COMMENT "RowLocker LockId needed to update a pre-paid contact attempt",
    PRIMARY KEY ( id ),
    KEY ( ZoneId,BillingItemId ),
    KEY ( ZoneId,LaunchId,NotifyCallId ),
    KEY ( LockId )

) ENGINE=INNODB CHARSET=UTF8 COMMENT="Table that logs and classifies all the contact attempts";
