mirror of
https://github.com/mudabbir-ahmad/peworkshop.git
synced 2026-10-07 19:50:20 +00:00
fixed a bit
This commit is contained in:
1 parent
ee2b62df83
commit
ed8199058a
1 file changed
+1
-10
+1
-10
@@ -1,12 +1,9 @@
|
||||
-- Schema for clue_hunt.db
|
||||
|
||||
-- Drop tables if they exist
|
||||
DROP TABLE IF EXISTS clues;
|
||||
DROP TABLE IF EXISTS users;
|
||||
DROP TABLE IF EXISTS teams;
|
||||
DROP TABLE IF EXISTS game_settings;
|
||||
|
||||
-- Users table
|
||||
CREATE TABLE users (
|
||||
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
||||
username TEXT UNIQUE NOT NULL,
|
||||
@@ -17,7 +14,6 @@ CREATE TABLE users (
|
||||
FOREIGN KEY (team_id) REFERENCES teams(id)
|
||||
);
|
||||
|
||||
-- Teams table
|
||||
CREATE TABLE teams (
|
||||
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
||||
name TEXT NOT NULL,
|
||||
@@ -25,7 +21,6 @@ CREATE TABLE teams (
|
||||
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
|
||||
);
|
||||
|
||||
-- Clues table
|
||||
CREATE TABLE clues (
|
||||
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
||||
description TEXT NOT NULL,
|
||||
@@ -36,7 +31,6 @@ CREATE TABLE clues (
|
||||
FOREIGN KEY (team_id) REFERENCES teams(id)
|
||||
);
|
||||
|
||||
-- Game settings table
|
||||
CREATE TABLE game_settings (
|
||||
id INTEGER PRIMARY KEY,
|
||||
hunt_active BOOLEAN DEFAULT FALSE,
|
||||
@@ -44,17 +38,14 @@ CREATE TABLE game_settings (
|
||||
updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
|
||||
);
|
||||
|
||||
-- Insert initial admin user
|
||||
|
||||
INSERT INTO users (username, password, role)
|
||||
VALUES ('admin', '$2a$10$N9qo8uLOickgx2ZMRZoMyeIjZAgcfl7p92ldGxad68LJZdL17lhWy', 'admin');
|
||||
-- Password is 'password123' - change this in production!
|
||||
|
||||
-- Insert sample teams
|
||||
INSERT INTO teams (name, code) VALUES ('Team Alpha', 'ALPHA123');
|
||||
INSERT INTO teams (name, code) VALUES ('Team Beta', 'BETA456');
|
||||
INSERT INTO teams (name, code) VALUES ('Team Gamma', 'GAMMA789');
|
||||
|
||||
-- Insert sample clues for Team Alpha
|
||||
INSERT INTO clues (description, team_id) VALUES ('Find the red door', 1);
|
||||
INSERT INTO clues (description, team_id) VALUES ('Look under the bridge', 1);
|
||||
INSERT INTO clues (description, team_id) VALUES ('Check the library', 1);
|
||||
|
||||
Reference in new issue
Block a user