fix: add missing qr_scans table creation to fix 500 error on /api/qr

This commit is contained in:
Mohan Ki
2026-07-27 16:38:23 +05:30
parent 8c17fac692
commit 386071f48d
2 changed files with 26 additions and 0 deletions
+13
View File
@@ -18,3 +18,16 @@ CREATE TABLE IF NOT EXISTS qr_codes (
design_data JSONB, -- Custom styling
created_at TIMESTAMP WITH TIME ZONE DEFAULT CURRENT_TIMESTAMP
);
CREATE TABLE IF NOT EXISTS qr_scans (
id UUID PRIMARY KEY DEFAULT uuid_generate_v4(),
qr_code_id UUID REFERENCES qr_codes(id) ON DELETE CASCADE,
ip_address VARCHAR(45),
user_agent TEXT,
os VARCHAR(50),
device_type VARCHAR(50),
browser VARCHAR(50),
country VARCHAR(100),
city VARCHAR(100),
scanned_at TIMESTAMP WITH TIME ZONE DEFAULT CURRENT_TIMESTAMP
);