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) {
title='2021-01-12 18:19:21 -0500'>2021-01-12List both Makefile and html.sh under README.7June McEnroe 2021-01-12Add htagml exampleJune McEnroe 2021-01-12Use mandoc and htagml for bin htmlJune McEnroe 2021-01-12Add htagmlJune McEnroe 2021-01-12Replace causal.agency with a simple mdoc pageJune McEnroe 2021-01-11Publish "Using vi"June McEnroe 2021-01-11Enable diff.colorMovedJune McEnroe 2021-01-10Set less search case-insensitiveJune McEnroe 2021-01-10Set EXINITJune McEnroe neovim is laggy as hell in my OpenBSD VM, so I switched to vi so I could type without getting frustrated. 2021-01-09Add c -t flag to print expression typeJune McEnroe Also add missing float case. 2021-01-05Update taglineJune McEnroe