fix: add missing qr_scans table creation to fix 500 error on /api/qr
This commit is contained in:
@@ -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
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user