CREATE TABLE IF NOT EXISTS log (
id INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
level VARCHAR(20) NOT NULL,
timestamp DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
javascript TINYINT(1) NOT NULL DEFAULT 0,
file VARCHAR(255) DEFAULT NULL,
line INT DEFAULT NULL,
message TEXT
);

CREATE TABLE IF NOT EXISTS bank_log (
id INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
timestamp DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
amount VARCHAR(30),
identification VARCHAR(255),
basket_id INT,
tid VARCHAR(20),
card_brand VARCHAR(255),
client_ticket TEXT,
merchant_ticket TEXT
);

CREATE TABLE IF NOT EXISTS bank_terminal (
id INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
firstSeen DATETIME,
lastSeen DATETIME,
tid VARCHAR(20),
ip varchar(40)
);

CREATE TABLE IF NOT EXISTS nfc_key (
id INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
uid VARCHAR(30) NOT NULL,
timestamp DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
sector INT,
keyA VARCHAR(255)
);
