added backend for user management

This commit is contained in:
2025-10-08 17:25:34 +02:00
parent 4e120c8789
commit a6ec865571
6 changed files with 421 additions and 71 deletions

View File

@@ -21,4 +21,20 @@ CREATE TABLE IF NOT EXISTS assigned_shifts (
required_employees INTEGER DEFAULT 1,
assigned_employees TEXT DEFAULT '[]', -- JSON array of user IDs
FOREIGN KEY (shift_plan_id) REFERENCES shift_plans(id) ON DELETE CASCADE
);
);
-- Zusätzliche Tabelle für Mitarbeiter-Verfügbarkeiten
CREATE TABLE IF NOT EXISTS employee_availabilities (
id TEXT PRIMARY KEY,
employee_id TEXT NOT NULL,
day_of_week INTEGER NOT NULL CHECK (day_of_week >= 0 AND day_of_week <= 6),
start_time TEXT NOT NULL,
end_time TEXT NOT NULL,
is_available BOOLEAN DEFAULT FALSE,
FOREIGN KEY (employee_id) REFERENCES users(id) ON DELETE CASCADE
);
-- Users Tabelle erweitern um zusätzliche Felder
ALTER TABLE users ADD COLUMN phone TEXT;
ALTER TABLE users ADD COLUMN department TEXT;
ALTER TABLE users ADD COLUMN is_active BOOLEAN DEFAULT TRUE;