Merge GitHub updates into Gitea master
All checks were successful
Build & Push Docker Image / build-and-push (push) Successful in 1m53s

This commit is contained in:
Tom Misch
2026-05-11 13:03:58 +02:00
18 changed files with 1768 additions and 88 deletions

View File

@@ -17,7 +17,15 @@ db.serialize(() => {
created_at DATETIME DEFAULT CURRENT_TIMESTAMP
)`);
// Migration: created_at hinzufuegen falls Tabelle schon existiert
// Migration: Spalten hinzufuegen falls Tabelle schon existiert (alte DB ohne role/created_at)
db.run(`ALTER TABLE users ADD COLUMN role TEXT NOT NULL DEFAULT 'client'`, (err) => {
// Ignoriere Fehler wenn Spalte schon existiert
if (!err) {
// Alte Admins (die einzigen User vor dem Update) als admin markieren
db.run(`UPDATE users SET role = 'admin' WHERE id = 1`);
console.log('Migration: role-Spalte hinzugefuegt, User ID 1 als admin gesetzt');
}
});
db.run(`ALTER TABLE users ADD COLUMN created_at DATETIME DEFAULT CURRENT_TIMESTAMP`, (err) => {
// Ignoriere Fehler wenn Spalte schon existiert
});