diff --git a/src/ssb.db.c b/src/ssb.db.c
index fe68b6eb..54b08f5e 100644
--- a/src/ssb.db.c
+++ b/src/ssb.db.c
@@ -139,8 +139,8 @@ void tf_ssb_db_init(tf_ssb_t* ssb)
 		_tf_ssb_db_exec(db,
 			"CREATE TABLE IF NOT EXISTS messages_stats ("
 			"  author TEXT PRIMARY KEY,"
-			"  max_sequence INTEGER,"
-			"  max_timestamp REAL"
+			"  max_sequence INTEGER NOT NULL,"
+			"  max_timestamp REAL NOT NULL"
 			")");
 		_tf_ssb_db_exec(
 			db, "INSERT OR REPLACE INTO messages_stats (author, max_sequence, max_timestamp) SELECT author, MAX(sequence), MAX(timestamp) FROM messages GROUP BY author");