Index: src/config/database.js
===================================================================
--- src/config/database.js	(revision 7d932ce99c5c723eafe823cbe34b8bf8d5bf884a)
+++ src/config/database.js	(revision dc8e9bda703d78ef43df97ab8ad71d9a93d94316)
@@ -267,6 +267,15 @@
       created_at DATETIME DEFAULT CURRENT_TIMESTAMP
     );
-    CREATE INDEX IF NOT EXISTS idx_unotif_user ON user_notifications(user_id, read, created_at);
-  `);
+  `);
+  // Older DBs may have a user_notifications table predating these columns — add
+  // them before the index (which references `read`), else boot crashes.
+  ensureColumn('user_notifications', 'type', 'TEXT');
+  ensureColumn('user_notifications', 'actor_id', 'TEXT');
+  ensureColumn('user_notifications', 'actor_name', 'TEXT');
+  ensureColumn('user_notifications', 'post_slug', 'TEXT');
+  ensureColumn('user_notifications', 'post_title', 'TEXT');
+  ensureColumn('user_notifications', 'url', 'TEXT');
+  ensureColumn('user_notifications', 'read', 'INTEGER DEFAULT 0');
+  db.exec('CREATE INDEX IF NOT EXISTS idx_unotif_user ON user_notifications(user_id, read, created_at);');
 
   // Link-in-bio click statistics (premium #6). One counter per (site, url); the
