diff options
Diffstat (limited to 'common/storage/entitystore.cpp')
-rw-r--r-- | common/storage/entitystore.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/common/storage/entitystore.cpp b/common/storage/entitystore.cpp index 7da7efa..6021344 100644 --- a/common/storage/entitystore.cpp +++ b/common/storage/entitystore.cpp | |||
@@ -158,6 +158,15 @@ EntityStore::EntityStore(const ResourceContext &context, const Log::Context &ctx | |||
158 | 158 | ||
159 | } | 159 | } |
160 | 160 | ||
161 | void EntityStore::createIfMissing() | ||
162 | { | ||
163 | if (!d->exists()) { | ||
164 | startTransaction(Sink::Storage::DataStore::ReadWrite); | ||
165 | Storage::DataStore::setDatabaseVersion(d->transaction, Sink::latestDatabaseVersion()); | ||
166 | commitTransaction(); | ||
167 | } | ||
168 | } | ||
169 | |||
161 | void EntityStore::startTransaction(Sink::Storage::DataStore::AccessMode accessMode) | 170 | void EntityStore::startTransaction(Sink::Storage::DataStore::AccessMode accessMode) |
162 | { | 171 | { |
163 | SinkTraceCtx(d->logCtx) << "Starting transaction: " << accessMode; | 172 | SinkTraceCtx(d->logCtx) << "Starting transaction: " << accessMode; |