Page MenuHomePhabricator

D3584.diff
No OneTemporary

D3584.diff

diff --git a/services/backup/docker-server/contents/server/src/DatabaseEntities/BackupItem.h b/services/backup/docker-server/contents/server/src/DatabaseEntities/BackupItem.h
--- a/services/backup/docker-server/contents/server/src/DatabaseEntities/BackupItem.h
+++ b/services/backup/docker-server/contents/server/src/DatabaseEntities/BackupItem.h
@@ -62,6 +62,8 @@
BackupItem(const AttributeValues &itemFromDB);
void assignItemFromDatabase(const AttributeValues &itemFromDB) override;
+ void
+ assignItemFromDatabaseUserIDCreatedIndex(const AttributeValues &itemFromDB);
std::string getTableName() const override;
PrimaryKey getPrimaryKey() const override;
diff --git a/services/backup/docker-server/contents/server/src/DatabaseEntities/BackupItem.cpp b/services/backup/docker-server/contents/server/src/DatabaseEntities/BackupItem.cpp
--- a/services/backup/docker-server/contents/server/src/DatabaseEntities/BackupItem.cpp
+++ b/services/backup/docker-server/contents/server/src/DatabaseEntities/BackupItem.cpp
@@ -74,6 +74,21 @@
this->validate();
}
+void BackupItem::assignItemFromDatabaseUserIDCreatedIndex(
+ const AttributeValues &itemFromDB) {
+ try {
+ this->userID = itemFromDB.at(BackupItem::FIELD_USER_ID).GetS();
+ this->backupID = itemFromDB.at(BackupItem::FIELD_BACKUP_ID).GetS();
+ this->created = std::stoll(
+ std::string(itemFromDB.at(BackupItem::FIELD_CREATED).GetS()).c_str());
+ this->recoveryData = itemFromDB.at(BackupItem::FIELD_RECOVERY_DATA).GetS();
+ } catch (std::logic_error &e) {
+ throw std::runtime_error(
+ "invalid backup item provided, " + std::string(e.what()));
+ }
+ this->validate();
+}
+
std::string BackupItem::getTableName() const {
return BackupItem::tableName;
}

File Metadata

Mime Type
text/plain
Expires
Sun, Nov 24, 12:37 PM (21 h, 49 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2575592
Default Alt Text
D3584.diff (1 KB)

Event Timeline