From: Waqas Hussain Date: Tue, 28 Jul 2009 00:33:51 +0000 (+0500) Subject: ejabberdsql2prosody: Allow for multiple INSERTs to the same table X-Git-Url: https://git.enpas.org/?a=commitdiff_plain;h=4e16323f2a78a2f20bcd75957f2ada27a5d8b90f;hp=539017cb736e4b52f5b882e37f2bdf95af9e59e7;p=prosody.git ejabberdsql2prosody: Allow for multiple INSERTs to the same table --- diff --git a/tools/ejabberdsql2prosody.lua b/tools/ejabberdsql2prosody.lua index b3077331..5b975269 100644 --- a/tools/ejabberdsql2prosody.lua +++ b/tools/ejabberdsql2prosody.lua @@ -136,7 +136,14 @@ local function readFile(filename) while true do local tname, tuples = readInsert(); if tname then - t[tname] = tuples; + if t[name] then + local t_name = t[name]; + for i=1,#tuples do + table.insert(t_name, tuples[i]); + end + else + t[tname] = tuples; + end elseif peek() == nil then break; end