about summary refs log tree commit diff
path: root/database.h
diff options
context:
space:
mode:
Diffstat (limited to 'database.h')
-rw-r--r--database.h11
1 files changed, 9 insertions, 2 deletions
diff --git a/database.h b/database.h
index a0cba04..fb59140 100644
--- a/database.h
+++ b/database.h
@@ -42,7 +42,7 @@
 
 #define DATABASE_PATH "litterbox/litterbox.sqlite"
 
-enum { DatabaseVersion = 3 };
+enum { DatabaseVersion = 4 };
 
 #define ENUM_TYPE \
 	X(Privmsg, "privmsg") \
@@ -323,7 +323,7 @@ static const char *InitSQL = SQL(
 		UNIQUE (host, port)
 	);
 
-	PRAGMA user_version = 3;
+	PRAGMA user_version = 4;
 
 	COMMIT TRANSACTION;
 );
@@ -363,6 +363,13 @@ static const char *MigrationSQL[] = {
 		CREATE INDEX eventsTime ON events (time);
 		PRAGMA user_version = 3;
 	),
+
+	SQL(
+		UPDATE motds SET time = strftime('%s', time);
+		UPDATE topics SET time = strftime('%s', time);
+		UPDATE events SET time = strftime('%s', time);
+		PRAGMA user_version = 4;
+	),
 };
 
 static inline void dbMigrate(void) {