added missing item fields in saveItem()

This commit is contained in:
skilion 2016-12-29 00:36:42 +01:00
parent 0afb6fa392
commit 203062fc6b
2 changed files with 4 additions and 2 deletions

View file

@ -22,7 +22,7 @@ struct Item
final class ItemDatabase
{
// increment this for every change in the db schema
immutable int itemDatabaseVersion = 1;
immutable int itemDatabaseVersion = 2;
Database db;
Statement insertItemStmt;
@ -35,7 +35,7 @@ final class ItemDatabase
db = Database(filename);
if (db.getVersion() == 0) {
db.exec("CREATE TABLE item (
id TEXT PRIMARY KEY,
id TEXT NOT NULL PRIMARY KEY,
name TEXT NOT NULL,
type TEXT NOT NULL,
eTag TEXT NOT NULL,

View file

@ -522,7 +522,9 @@ final class SyncEngine
assert(0);
}
Item item = {
id: id,
name: jsonItem["name"].str,
type: type,
eTag: jsonItem["eTag"].str,
cTag: "cTag" in jsonItem ? jsonItem["cTag"].str : null,
mtime: SysTime.fromISOExtString(jsonItem["fileSystemInfo"]["lastModifiedDateTime"].str),