mirror of
https://github.com/nextcloud/desktop.git
synced 2024-10-29 00:26:33 +03:00
Create an empty metadata table if non exists.
This commit is contained in:
parent
fbfba8bfbb
commit
5852a2dd06
1 changed files with 26 additions and 0 deletions
|
@ -286,6 +286,32 @@ int csync_statedb_create_tables(CSYNC *ctx) {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
c_strlist_destroy(result);
|
c_strlist_destroy(result);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Create the 'real' table in case it does not exist. This is important
|
||||||
|
* for first time sync. Otherwise other functions that query metadata
|
||||||
|
* table whine about the table not existing.
|
||||||
|
*/
|
||||||
|
result = csync_statedb_query(ctx,
|
||||||
|
"CREATE TABLE IF NOT EXISTS metadata("
|
||||||
|
"phash INTEGER(8),"
|
||||||
|
"pathlen INTEGER,"
|
||||||
|
"path VARCHAR(4096),"
|
||||||
|
"inode INTEGER,"
|
||||||
|
"uid INTEGER,"
|
||||||
|
"gid INTEGER,"
|
||||||
|
"mode INTEGER,"
|
||||||
|
"modtime INTEGER(8),"
|
||||||
|
"PRIMARY KEY(phash)"
|
||||||
|
");"
|
||||||
|
);
|
||||||
|
|
||||||
|
if (result == NULL) {
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
c_strlist_destroy(result);
|
||||||
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue