debug: Tabellen-Status Endpoint

This commit is contained in:
2026-06-13 12:34:26 +02:00
parent 9f84dd2929
commit 1a93fc611d

View File

@@ -59,4 +59,14 @@ router.delete('/:id', authenticate, (req, res) => {
res.json({ ok: true }); res.json({ ok: true });
}); });
// Debug: Tabellenstatus prüfen
router.get('/debug-table', (req, res) => {
try {
const exists = db.prepare("SELECT name FROM sqlite_master WHERE type='table' AND name='public_file_shares'").get();
const count = exists ? db.prepare('SELECT COUNT(*) as n FROM public_file_shares').get() : null;
const cols = exists ? db.pragma('table_info(public_file_shares)').map(c=>c.name) : [];
res.json({ exists: !!exists, count: count?.n, cols });
} catch(e) { res.status(500).json({ error: e.message }); }
});
module.exports = router; module.exports = router;