Index: src/config/database.js
===================================================================
--- src/config/database.js	(revision 075185aec7ff8542aa40c1e84a7a70cb05f7599f)
+++ src/config/database.js	(revision 2e9773f664c16b98d6ebb6626b4e5a498f38c448)
@@ -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
