From 699dab7c6d9eec4565b11f76d1e27d17321176df Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Sat, 8 Apr 2017 16:33:42 +0200 Subject: migration/prosody_sql: Commit transaction when all items have been processed --- tools/migration/migrator/prosody_sql.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tools') diff --git a/tools/migration/migrator/prosody_sql.lua b/tools/migration/migrator/prosody_sql.lua index 2dd07bdc..642b74c2 100644 --- a/tools/migration/migrator/prosody_sql.lua +++ b/tools/migration/migrator/prosody_sql.lua @@ -161,7 +161,7 @@ local function writer(output, iter) local insert_sql = "INSERT INTO `prosody` (`host`,`user`,`store`,`key`,`type`,`value`) VALUES (?,?,?,?,?,?)"; return function(item) - if not item then return end -- end of input + if not item then assert(engine.conn:commit()) return end -- end of input local host = item.host or ""; local user = item.user or ""; for store, data in pairs(item.stores) do -- cgit v1.2.3