ejabberdsql2prosody: Allow for multiple INSERTs to the same table
authorWaqas Hussain <waqas20@gmail.com>
Tue, 28 Jul 2009 00:33:51 +0000 (05:33 +0500)
committerWaqas Hussain <waqas20@gmail.com>
Tue, 28 Jul 2009 00:33:51 +0000 (05:33 +0500)
tools/ejabberdsql2prosody.lua

index b30773317d14e07bd29dc65624dfd1b73aec8612..5b9752692eea59d272c8257b188ae7474851fb92 100644 (file)
@@ -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