Projektsuche Implementiert mit anbindung an INFRA

This commit is contained in:
2026-03-13 16:49:38 +01:00
parent 91603f1617
commit 1d8ba6a955
10 changed files with 1965 additions and 27 deletions

View File

@@ -336,6 +336,31 @@ function initDatabase() {
}
});
// MSSQL-Konfigurations-Tabelle für externe Projekt-/Kunden-Datenbank
db.run(`CREATE TABLE IF NOT EXISTS mssql_config (
id INTEGER PRIMARY KEY DEFAULT 1,
server TEXT,
database TEXT,
username TEXT,
password TEXT,
updated_at DATETIME DEFAULT CURRENT_TIMESTAMP,
CHECK (id = 1)
)`, (err) => {
if (err && !err.message.includes('duplicate column')) {
console.warn('Warnung beim Erstellen der mssql_config Tabelle:', err.message);
}
});
// Standard-Eintrag für mssql_config erstellen falls nicht vorhanden
db.run(
`INSERT OR IGNORE INTO mssql_config (id, server, database, username, password) VALUES (1, '', '', '', '')`,
(err) => {
if (err && !err.message.includes('UNIQUE constraint')) {
console.warn('Warnung beim Erstellen des Standard-Eintrags für mssql_config:', err.message);
}
}
);
// Migration: Bestehende Rollen zu JSON-Arrays konvertieren
// Prüfe ob Rollen noch als einfache Strings gespeichert sind (nicht als JSON-Array)
db.all('SELECT id, role FROM users', (err, users) => {