summary refs log tree commit diff
path: root/database.h
diff options
context:
space:
mode:
Diffstat (limited to 'database.h')
-rw-r--r--database.h6
1 files changed, 2 insertions, 4 deletions
diff --git a/database.h b/database.h
index 117d7eb..da8c8da 100644
--- a/database.h
+++ b/database.h
@@ -323,7 +323,6 @@ static inline void dbInit(void) {
 static const char *MigrationSQL[] = {
 	// Added columnsize = 0 option.
 	SQL(
-		BEGIN TRANSACTION;
 		DROP TABLE search;
 		CREATE VIRTUAL TABLE search USING fts5 (
 			network, channel, query, nick, user, target, message,
@@ -336,11 +335,9 @@ static const char *MigrationSQL[] = {
 			rowid, network, channel, query, nick, user, target, message
 		) SELECT * FROM text;
 		PRAGMA user_version = 1;
-		COMMIT TRANSACTION;
 	),
 
 	SQL(
-		BEGIN TRANSACTION;
 		CREATE TABLE consumers (
 			host STRING NOT NULL,
 			port INTEGER NOT NULL,
@@ -348,14 +345,15 @@ static const char *MigrationSQL[] = {
 			UNIQUE (host, port)
 		);
 		PRAGMA user_version = 2;
-		COMMIT TRANSACTION;
 	),
 };
 
 static inline void dbMigrate(void) {
+	dbExec(SQL(BEGIN TRANSACTION;));
 	for (int version = dbVersion(); version < DatabaseVersion; ++version) {
 		dbExec(MigrationSQL[version]);
 	}
+	dbExec(SQL(COMMIT TRANSACTION;));
 }
 
 static inline void dbBackup(const char *path) {
lass='logsubject'>Skip matches with ident chars on either sideJune McEnroe This fixes, for example, where the link gets placed on static regex_t regex(const char *pattern, int flags) in title.c. 2022-03-24Add The Invisible Life of Addie LaRueJune McEnroe So good, but so long. Reminded me of The Ten Thousand Doors of January at the beginning, and more of that N. K. Jemisin series about gods later. I like this interacting with gods and becoming something like one sort of thing. God, it took me a whole month (more?) to read and this is only my third book of the year :( I need some more novellas to read, but the other books I have from the library currently are also thick. 2022-03-22Source ~/.profile.local if it existsJune McEnroe 2022-03-18Publish "Addendum 2021"June McEnroe 2022-03-16Remove wcwidth portJune McEnroe DYLD_FORCE_FLAT_NAMESPACE no longer exists in macOS 12 so this approach doesn't work anymore. Moved to <https://git.causal.agency/jorts/tree/wcwidth> and compiled into <https://git.causal.agency/jorts/tree/ncurses>. 2022-03-16Remove -j4 from ./PlanJune McEnroe Plan learned to set this automatically! 2022-03-15Rewrite Linux install.sh for DebianJune McEnroe 2022-03-15Remove dashJune McEnroe