diff options
author | Greg Soltis <gsoltis@google.com> | 2018-01-30 14:36:22 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-01-30 14:36:22 -0800 |
commit | 3cbdbf2652202a3473271ed298ff50e5797cce68 (patch) | |
tree | 3b24b8feff76b3f7551bd17ffd8f1caa38c552ad /Firestore/Source/Local/FSTLevelDBKey.mm | |
parent | 6474a82fd6e0e10b2cf97c4dc531e837ec97792b (diff) |
Schema migrations for LevelDB (#728)
* Implement schema versions
* Style fixes
* newlines, copyrights, assumptions
* Fix nullability
* Raw ptr -> shared_ptr
* kVersionTableGlobal -> kVersionGlobalTable
* Drop utils, move into static methods
* Drop extra include
* Add a few more comments
* Move version constant into migrations file
* formatting?
* Fix comment
Diffstat (limited to 'Firestore/Source/Local/FSTLevelDBKey.mm')
-rw-r--r-- | Firestore/Source/Local/FSTLevelDBKey.mm | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/Firestore/Source/Local/FSTLevelDBKey.mm b/Firestore/Source/Local/FSTLevelDBKey.mm index 9850fff..41aea39 100644 --- a/Firestore/Source/Local/FSTLevelDBKey.mm +++ b/Firestore/Source/Local/FSTLevelDBKey.mm @@ -29,6 +29,7 @@ using firebase::firestore::util::OrderedCode; using Firestore::StringView; using leveldb::Slice; +static const char *kVersionGlobalTable = "version"; static const char *kMutationsTable = "mutation"; static const char *kDocumentMutationsTable = "document_mutation"; static const char *kMutationQueuesTable = "mutation_queue"; @@ -448,6 +449,17 @@ NSString *InvalidKey(const Slice &key) { @end +@implementation FSTLevelDBVersionKey + ++ (std::string)key { + std::string result; + WriteTableName(&result, kVersionGlobalTable); + WriteTerminator(&result); + return result; +} + +@end + @implementation FSTLevelDBMutationKey { std::string _userID; } |