Monotone-Parent: daeccf44f2750bfeb36858cb6386c86f90cc252a

Monotone-Revision: 43d241658c366d49394b3972e7951947d8271398

Monotone-Author: wsourdeau@inverse.ca
Monotone-Date: 2012-08-13T19:39:47
Monotone-Branch: ca.inverse.sogo
This commit is contained in:
Wolfgang Sourdeau
2012-08-13 19:39:47 +00:00
parent c4ad9891b3
commit 149be2b43f
+12 -16
View File
@@ -242,22 +242,18 @@ Class SOGoMAPIDBObjectK = Nil;
{
record = [records objectAtIndex: count];
path = [record objectForKey: @"c_path"];
if ([path isEqualToString: oldPath]
|| [path hasPrefix: oldPathAsPrefix])
{
sql = [NSMutableString stringWithFormat: @"UPDATE %@"
@" SET c_path = '%@'",
[self tableName],
[path stringByReplacingPrefix: oldPath
withPrefix: newPath]];
parentPath = [record objectForKey: @"c_parent_path"];
if ([parentPath isNotNull])
[sql appendFormat: @", c_parent_path = '%@'",
[parentPath stringByReplacingPrefix: oldPath
withPrefix: newPath]];
[sql appendFormat: @" WHERE c_path = '%@'", oldPath];
[queries addObject: sql];
}
sql = [NSMutableString stringWithFormat: @"UPDATE %@"
@" SET c_path = '%@'",
[self tableName],
[path stringByReplacingPrefix: oldPath
withPrefix: newPath]];
parentPath = [record objectForKey: @"c_parent_path"];
if ([parentPath isNotNull])
[sql appendFormat: @", c_parent_path = '%@'",
[parentPath stringByReplacingPrefix: oldPath
withPrefix: newPath]];
[sql appendFormat: @" WHERE c_path = '%@'", path];
[queries addObject: sql];
}
[self performBatchSQLQueries: queries];
}