@@ -367,10 +367,10 @@ Error Database::GetAllInstancesInfos([[maybe_unused]] Array<InstanceInfo>& infos
367367 try {
368368 std::vector<InstanceInfoRow> rows;
369369
370- *mSession
371- << " SELECT itemID, subjectID, instance, type, version, manifestDigest, runtimeID, ownerID, subjectType , "
372- " uid, gid, priority, storagePath, statePath, envVars, networkParameters, monitoringParams "
373- " FROM instances;" ,
370+ *mSession << " SELECT itemID, subjectID, instance, type, preinstalled, version, manifestDigest, "
371+ " runtimeID, ownerID, subjectType,uid, gid, priority, storagePath, statePath , "
372+ " envVars,networkParameters, monitoringParams "
373+ " FROM instances;" ,
374374 into (rows), now;
375375
376376 auto instanceInfo = std::make_unique<InstanceInfo>();
@@ -400,9 +400,10 @@ Error Database::UpdateInstanceInfo(const InstanceInfo& info)
400400
401401 FromAos (info, row);
402402
403- *mSession << " INSERT OR REPLACE INTO instances (itemID, subjectID, instance, type, version, manifestDigest, "
404- " runtimeID, ownerID, subjectType, uid, gid, priority, storagePath, statePath, envVars, "
405- " networkParameters, monitoringParams) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?);" ,
403+ *mSession
404+ << " INSERT OR REPLACE INTO instances (itemID, subjectID, instance, type, preinstalled, version, "
405+ " manifestDigest, runtimeID, ownerID, subjectType, uid, gid, priority, storagePath, statePath, envVars, "
406+ " networkParameters, monitoringParams) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?);" ,
406407 bind (row), now;
407408 } catch (const std::exception& e) {
408409 return AOS_ERROR_WRAP (common::utils::ToAosError (e));
@@ -420,9 +421,10 @@ Error Database::RemoveInstanceInfo(const InstanceIdent& ident)
420421 try {
421422 Poco::Data::Statement statement {*mSession };
422423
423- statement << " DELETE FROM instances WHERE itemID = ? AND subjectID = ? AND instance = ? AND type = ?;" ,
424+ statement << " DELETE FROM instances WHERE itemID = ? AND subjectID = ? AND instance = ? AND type = ? "
425+ " AND preinstalled = ?;" ,
424426 bind (ident.mItemID .CStr ()), bind (ident.mSubjectID .CStr ()), bind (ident.mInstance ),
425- bind (ident.mType .ToString ().CStr ());
427+ bind (ident.mType .ToString ().CStr ()), bind (ident. mPreinstalled ) ;
426428
427429 if (statement.execute () == 0 ) {
428430 return AOS_ERROR_WRAP (ErrorEnum::eNotFound);
@@ -759,6 +761,7 @@ void Database::FromAos(const InstanceInfo& src, InstanceInfoRow& dst)
759761 dst.set <ToInt (InstanceInfoColumns::eSubjectID)>(src.mSubjectID .CStr ());
760762 dst.set <ToInt (InstanceInfoColumns::eInstance)>(src.mInstance );
761763 dst.set <ToInt (InstanceInfoColumns::eType)>(src.mType .ToString ().CStr ());
764+ dst.set <ToInt (InstanceInfoColumns::ePreinstalled)>(src.mPreinstalled );
762765 dst.set <ToInt (InstanceInfoColumns::eVersion)>(src.mVersion .CStr ());
763766 dst.set <ToInt (InstanceInfoColumns::eManifestDigest)>(src.mManifestDigest .CStr ());
764767 dst.set <ToInt (InstanceInfoColumns::eRuntimeID)>(src.mRuntimeID .CStr ());
@@ -779,6 +782,7 @@ void Database::ToAos(const InstanceInfoRow& src, InstanceInfo& dst)
779782 dst.mItemID = src.get <ToInt (InstanceInfoColumns::eItemID)>().c_str ();
780783 dst.mSubjectID = src.get <ToInt (InstanceInfoColumns::eSubjectID)>().c_str ();
781784 dst.mInstance = src.get <ToInt (InstanceInfoColumns::eInstance)>();
785+ dst.mPreinstalled = src.get <ToInt (InstanceInfoColumns::ePreinstalled)>();
782786 dst.mVersion = src.get <ToInt (InstanceInfoColumns::eVersion)>().c_str ();
783787 dst.mManifestDigest = src.get <ToInt (InstanceInfoColumns::eManifestDigest)>().c_str ();
784788 dst.mRuntimeID = src.get <ToInt (InstanceInfoColumns::eRuntimeID)>().c_str ();
0 commit comments