mirror of
https://github.com/donpat1to/Schichtenplaner.git
synced 2025-12-01 15:05:45 +01:00
added backend for user management
This commit is contained in:
@@ -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;
|
||||
Reference in New Issue
Block a user