mirror of
https://github.com/Dvorinka/MyClubServer.git
synced 2026-06-04 02:32:57 +00:00
17 lines
561 B
SQL
17 lines
561 B
SQL
CREATE TABLE qr_codes (
|
|
id SERIAL PRIMARY KEY,
|
|
name VARCHAR(255) NOT NULL,
|
|
description TEXT,
|
|
target_url VARCHAR(500) NOT NULL,
|
|
qr_code_url VARCHAR(500),
|
|
scan_count INTEGER DEFAULT 0,
|
|
is_active BOOLEAN DEFAULT true,
|
|
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
|
|
updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
|
|
);
|
|
|
|
-- Indexes for performance
|
|
CREATE INDEX idx_qr_codes_created_at ON qr_codes(created_at);
|
|
CREATE INDEX idx_qr_codes_is_active ON qr_codes(is_active);
|
|
CREATE INDEX idx_qr_codes_target_url ON qr_codes(target_url);
|