Dieser Commit ist enthalten in:
hendrik_gebhardt@gmx.de
2026-01-06 21:49:26 +00:00
committet von Server Deploy
Ursprung 623bbdf5dd
Commit 7d67557be4
34 geänderte Dateien mit 21416 neuen und 2367 gelöschten Zeilen

Datei anzeigen

@ -485,6 +485,41 @@ function createTables() {
)
`);
// Erinnerungen
db.exec(`
CREATE TABLE IF NOT EXISTS reminders (
id INTEGER PRIMARY KEY AUTOINCREMENT,
project_id INTEGER NOT NULL,
title TEXT NOT NULL,
description TEXT,
reminder_date DATE NOT NULL,
reminder_time TIME DEFAULT '09:00',
color TEXT DEFAULT '#F59E0B',
advance_days TEXT DEFAULT '1',
repeat_type TEXT DEFAULT 'none',
repeat_interval INTEGER DEFAULT 1,
is_active INTEGER DEFAULT 1,
created_by INTEGER NOT NULL,
created_at DATETIME DEFAULT CURRENT_TIMESTAMP,
updated_at DATETIME DEFAULT CURRENT_TIMESTAMP,
FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE,
FOREIGN KEY (created_by) REFERENCES users(id)
)
`);
// Erinnerungs-Benachrichtigungen (für Tracking welche bereits gesendet wurden)
db.exec(`
CREATE TABLE IF NOT EXISTS reminder_notifications (
id INTEGER PRIMARY KEY AUTOINCREMENT,
reminder_id INTEGER NOT NULL,
notification_date DATE NOT NULL,
sent INTEGER DEFAULT 0,
created_at DATETIME DEFAULT CURRENT_TIMESTAMP,
FOREIGN KEY (reminder_id) REFERENCES reminders(id) ON DELETE CASCADE,
UNIQUE(reminder_id, notification_date)
)
`);
// Wissensmanagement - Kategorien
db.exec(`
CREATE TABLE IF NOT EXISTS knowledge_categories (
@ -561,6 +596,31 @@ function createTables() {
logger.info('Migration: claude_instructions Spalte zu coding_directories hinzugefuegt');
}
// Kontakte
db.exec(`
CREATE TABLE IF NOT EXISTS contacts (
id INTEGER PRIMARY KEY AUTOINCREMENT,
first_name TEXT,
last_name TEXT,
company TEXT,
position TEXT,
email TEXT,
phone TEXT,
mobile TEXT,
address TEXT,
postal_code TEXT,
city TEXT,
country TEXT,
website TEXT,
notes TEXT,
tags TEXT,
created_at DATETIME DEFAULT CURRENT_TIMESTAMP,
updated_at DATETIME DEFAULT CURRENT_TIMESTAMP,
created_by INTEGER,
FOREIGN KEY (created_by) REFERENCES users(id)
)
`);
// Indizes für Performance
db.exec(`
CREATE INDEX IF NOT EXISTS idx_tasks_project ON tasks(project_id);
@ -581,6 +641,8 @@ function createTables() {
CREATE INDEX IF NOT EXISTS idx_knowledge_entries_category ON knowledge_entries(category_id);
CREATE INDEX IF NOT EXISTS idx_knowledge_attachments_entry ON knowledge_attachments(entry_id);
CREATE INDEX IF NOT EXISTS idx_coding_directories_position ON coding_directories(position);
CREATE INDEX IF NOT EXISTS idx_contacts_company ON contacts(company);
CREATE INDEX IF NOT EXISTS idx_contacts_tags ON contacts(tags);
`);
logger.info('Datenbank-Tabellen erstellt');