mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-01-19 14:13:34 +01:00
Fixed some problems with the database convertion
This commit is contained in:
parent
932ad0eeeb
commit
6bcd2886e9
2 changed files with 38 additions and 20 deletions
|
@ -52,7 +52,7 @@ async.series([
|
|||
{
|
||||
log("get all padIds out of the database...");
|
||||
|
||||
etherpadDB.query("SELECT ID FROM PAD_META LIMIT", [], function(err, _padIDs)
|
||||
etherpadDB.query("SELECT ID FROM PAD_META", [], function(err, _padIDs)
|
||||
{
|
||||
padIDs = _padIDs;
|
||||
callback(err);
|
||||
|
@ -153,11 +153,14 @@ function convertPad(padId, callback)
|
|||
{
|
||||
if(!err)
|
||||
{
|
||||
//parse the pages
|
||||
for(var i=0,length=results.length;i<length;i++)
|
||||
try
|
||||
{
|
||||
parsePage(chatMessages, results[i].PAGESTART, results[i].OFFSETS, results[i].DATA, true);
|
||||
}
|
||||
//parse the pages
|
||||
for(var i=0,length=results.length;i<length;i++)
|
||||
{
|
||||
parsePage(chatMessages, results[i].PAGESTART, results[i].OFFSETS, results[i].DATA, true);
|
||||
}
|
||||
}catch(e) {err = e}
|
||||
}
|
||||
|
||||
callback(err);
|
||||
|
@ -172,11 +175,14 @@ function convertPad(padId, callback)
|
|||
{
|
||||
if(!err)
|
||||
{
|
||||
//parse the pages
|
||||
for(var i=0,length=results.length;i<length;i++)
|
||||
try
|
||||
{
|
||||
parsePage(changesets, results[i].PAGESTART, results[i].OFFSETS, results[i].DATA, false);
|
||||
}
|
||||
//parse the pages
|
||||
for(var i=0,length=results.length;i<length;i++)
|
||||
{
|
||||
parsePage(changesets, results[i].PAGESTART, results[i].OFFSETS, results[i].DATA, false);
|
||||
}
|
||||
}catch(e) {err = e}
|
||||
}
|
||||
|
||||
callback(err);
|
||||
|
@ -191,11 +197,14 @@ function convertPad(padId, callback)
|
|||
{
|
||||
if(!err)
|
||||
{
|
||||
//parse the pages
|
||||
for(var i=0,length=results.length;i<length;i++)
|
||||
try
|
||||
{
|
||||
parsePage(changesetsMeta, results[i].PAGESTART, results[i].OFFSETS, results[i].DATA, true);
|
||||
}
|
||||
//parse the pages
|
||||
for(var i=0,length=results.length;i<length;i++)
|
||||
{
|
||||
parsePage(changesetsMeta, results[i].PAGESTART, results[i].OFFSETS, results[i].DATA, true);
|
||||
}
|
||||
}catch(e) {err = e}
|
||||
}
|
||||
|
||||
callback(err);
|
||||
|
@ -210,7 +219,10 @@ function convertPad(padId, callback)
|
|||
{
|
||||
if(!err)
|
||||
{
|
||||
apool=JSON.parse(results[0].JSON).x;
|
||||
try
|
||||
{
|
||||
apool=JSON.parse(results[0].JSON).x;
|
||||
}catch(e) {err = e}
|
||||
}
|
||||
|
||||
callback(err);
|
||||
|
@ -225,11 +237,14 @@ function convertPad(padId, callback)
|
|||
{
|
||||
if(!err)
|
||||
{
|
||||
//parse the pages
|
||||
for(var i=0, length=results.length;i<length;i++)
|
||||
try
|
||||
{
|
||||
parsePage(authors, results[i].PAGESTART, results[i].OFFSETS, results[i].DATA, true);
|
||||
}
|
||||
//parse the pages
|
||||
for(var i=0, length=results.length;i<length;i++)
|
||||
{
|
||||
parsePage(authors, results[i].PAGESTART, results[i].OFFSETS, results[i].DATA, true);
|
||||
}
|
||||
}catch(e) {err = e}
|
||||
}
|
||||
|
||||
callback(err);
|
||||
|
@ -244,7 +259,10 @@ function convertPad(padId, callback)
|
|||
{
|
||||
if(!err)
|
||||
{
|
||||
padmeta = JSON.parse(results[0].JSON).x;
|
||||
try
|
||||
{
|
||||
padmeta = JSON.parse(results[0].JSON).x;
|
||||
}catch(e) {err = e}
|
||||
}
|
||||
|
||||
callback(err);
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
{
|
||||
"etherpad-db":
|
||||
"etherpadDB":
|
||||
{
|
||||
"host": "localhost",
|
||||
"port": 3306,
|
||||
|
|
Loading…
Reference in a new issue