
DROP TABLE User2FATokens;

CREATE TABLE User2FATokens (
    id INT PRIMARY KEY AUTO_INCREMENT UNIQUE NOT NULL,
    created_at TIMESTAMP NOT NULL DEFAULT(CURRENT_TIMESTAMP),
    last_modified TIMESTAMP NOT NULL DEFAULT(CURRENT_TIMESTAMP) ON UPDATE CURRENT_TIMESTAMP,
    user_id INT NOT NULL,
    authenticated BOOLEAN DEFAULT('0') NOT NULL,
    sms_code VARCHAR(6) NOT NULL,
    encryption_key VARCHAR(99) NOT NULL,
    attempts INT DEFAULT('0')
);
