Add hunts table and default row; improve error handling and UI for team management

This commit is contained in:
bobbert committed 2025-03-12 15:48:35 +00:00
1 parent cd9c106ba1
commit a6ed24b2e6
8 files changed
+156 -52

No files matched your search

+16
View File
@@ -44,6 +44,22 @@ CREATE TABLE game_settings (
updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);
-- Execute this in your database:
CREATE TABLE IF NOT EXISTS hunts (
id INT AUTO_INCREMENT PRIMARY KEY,
active BOOLEAN DEFAULT FALSE,
start_time DATETIME DEFAULT NULL,
end_time DATETIME DEFAULT NULL,
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);
-- Insert a default hunt row if none exists:
INSERT INTO hunts (active)
SELECT FALSE
WHERE NOT EXISTS (SELECT 1 FROM hunts LIMIT 1);
-- Insert initial admin user
INSERT INTO users (username, password, role)
VALUES ('admin', '$2a$10$N9qo8uLOickgx2ZMRZoMyeIjZAgcfl7p92ldGxad68LJZdL17lhWy', 'admin');