Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3354261
D3584.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
D3584.diff
View Options
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
Details
Attached
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)
Attached To
Mode
D3584: [services] Backup - consider index for BackupItem
Attached
Detach File
Event Timeline
Log In to Comment