ALTER TABLE `xplugin_sd_bonuspunkte_in`
    ADD COLUMN usedPoints DOUBLE UNSIGNED DEFAULT 0;

ALTER TABLE `xplugin_sd_bonuspunkte_in`
    ADD INDEX usedPoints_index (usedPoints);
ALTER TABLE `xplugin_sd_bonuspunkte_in`
    ADD INDEX (createTime);

CREATE TABLE `xplugin_sd_bonuspunkte_log`
(
    `id`          INT(10) NOT NULL AUTO_INCREMENT,
    `bonus_in_id` INT(10) UNSIGNED,
    `kBestellung` INT(10) UNSIGNED DEFAULT 0,
    `kKunde` INT(10) UNSIGNED DEFAULT 0,
    `nGuthaben`   DOUBLE,
    `createTime`  DATETIME         DEFAULT CURRENT_TIMESTAMP,
    PRIMARY KEY (`id`),
    index (bonus_in_id),
    index (kBestellung),
    index (kKunde),
    index (nGuthaben),
    index (createTime)
);
