CREATE TABLE IF NOT EXISTS `d3totp` (
    `OXID` CHAR(32) NOT NULL ,
    `OXUSERID` CHAR(32) NOT NULL ,
    `USETOTP` TINYINT(1) NOT NULL  DEFAULT 0,
    `SEED` VARCHAR(256) NOT NULL ,
    `OXTIMESTAMP` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT 'Timestamp', 
    PRIMARY KEY (`OXID`) , 
    UNIQUE KEY  `OXUSERID` (`OXUSERID`) 
)  
ENGINE=InnoDB 
COMMENT='totp setting';

CREATE TABLE IF NOT EXISTS `d3totp_backupcodes` (
    `OXID` CHAR(32) NOT NULL ,
    `OXUSERID` CHAR(32) NOT NULL  COMMENT 'user id',
    `BACKUPCODE` VARCHAR(64) NOT NULL  COMMENT 'BackupCode',
    `OXTIMESTAMP` TIMESTAMP   NOT NULL  DEFAULT CURRENT_TIMESTAMP COMMENT 'Timestamp', 
    PRIMARY KEY (`OXID`) ,  
    KEY  `OXUSERID` (`OXUSERID`) ,  
    KEY  `BACKUPCODE` (`BACKUPCODE`) 
)  
ENGINE=InnoDB
COMMENT='totp backup codes';
