From 39e1b4b1df2c49739e89b80f4b4351a4e6b20f81 Mon Sep 17 00:00:00 2001 From: Waqas Hussain Date: Tue, 28 Jul 2009 05:33:51 +0500 Subject: ejabberdsql2prosody: Allow for multiple INSERTs to the same table --- tools/ejabberdsql2prosody.lua | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'tools/ejabberdsql2prosody.lua') 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 -- cgit v1.2.3