
CREATE DATABASE qr_saas;
USE qr_saas;

CREATE TABLE users (
 id INT AUTO_INCREMENT PRIMARY KEY,
 email VARCHAR(100),
 password VARCHAR(255)
);

CREATE TABLE qr_codes (
 id INT AUTO_INCREMENT PRIMARY KEY,
 user_id INT,
 code VARCHAR(50),
 target TEXT,
 file VARCHAR(255),
 created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);

CREATE TABLE scans (
 id INT AUTO_INCREMENT PRIMARY KEY,
 qr_id INT,
 ip VARCHAR(50),
 user_agent TEXT,
 created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);
