Lots of UI and admin changes, need to clean up the three audit log tables and a few other niggles.
This commit is contained in:
@@ -184,5 +184,22 @@ func InitDB(filepath string) *sql.DB {
|
||||
if _, err := db.Exec(createAdminAccessLogTable); err != nil {
|
||||
log.Fatal("❌ Failed to create admin access log table:", err)
|
||||
}
|
||||
|
||||
createNewAuditLogTable := `
|
||||
CREATE TABLE IF NOT EXISTS audit_log (
|
||||
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
||||
user_id INTEGER,
|
||||
username TEXT,
|
||||
action TEXT,
|
||||
path TEXT,
|
||||
ip TEXT,
|
||||
user_agent TEXT,
|
||||
timestamp DATETIME DEFAULT CURRENT_TIMESTAMP
|
||||
);`
|
||||
|
||||
if _, err := db.Exec(createNewAuditLogTable); err != nil {
|
||||
log.Fatal("❌ Failed to create admin access log table:", err)
|
||||
}
|
||||
|
||||
return db
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user