feat(Core/DBUpdater): include pending path (#21469)
This commit is contained in:
parent
8cfe71e27e
commit
3291c747c5
10
data/sql/updates/pending_db_auth/rev_1739664850515709200.sql
Normal file
10
data/sql/updates/pending_db_auth/rev_1739664850515709200.sql
Normal file
@ -0,0 +1,10 @@
|
||||
--
|
||||
ALTER TABLE `updates`
|
||||
CHANGE COLUMN `state` `state` ENUM('RELEASED','CUSTOM','MODULE','ARCHIVED','PENDING') NOT NULL DEFAULT 'RELEASED' COMMENT 'defines if an update is released or archived.' COLLATE 'utf8mb4_unicode_ci' AFTER `hash`;
|
||||
|
||||
ALTER TABLE `updates_include`
|
||||
CHANGE COLUMN `state` `state` ENUM('RELEASED','ARCHIVED','CUSTOM','PENDING') NOT NULL DEFAULT 'RELEASED' COMMENT 'defines if the directory contains released or archived updates.' COLLATE 'utf8mb4_unicode_ci' AFTER `path`;
|
||||
|
||||
DELETE FROM `updates_include` WHERE `path` = '$/data/sql/updates/pending_db_auth';
|
||||
INSERT INTO `updates_include` (`path`, `state`) VALUES
|
||||
('$/data/sql/updates/pending_db_auth', 'PENDING');
|
||||
@ -0,0 +1,10 @@
|
||||
--
|
||||
ALTER TABLE `updates`
|
||||
CHANGE COLUMN `state` `state` ENUM('RELEASED','CUSTOM','MODULE','ARCHIVED','PENDING') NOT NULL DEFAULT 'RELEASED' COMMENT 'defines if an update is released or archived.' COLLATE 'utf8mb4_unicode_ci' AFTER `hash`;
|
||||
|
||||
ALTER TABLE `updates_include`
|
||||
CHANGE COLUMN `state` `state` ENUM('RELEASED','ARCHIVED','CUSTOM','PENDING') NOT NULL DEFAULT 'RELEASED' COMMENT 'defines if the directory contains released or archived updates.' COLLATE 'utf8mb4_unicode_ci' AFTER `path`;
|
||||
|
||||
DELETE FROM `updates_include` WHERE `path` = '$/data/sql/updates/pending_db_characters';
|
||||
INSERT INTO `updates_include` (`path`, `state`) VALUES
|
||||
('$/data/sql/updates/pending_db_characters', 'PENDING');
|
||||
@ -0,0 +1,10 @@
|
||||
--
|
||||
ALTER TABLE `updates`
|
||||
CHANGE COLUMN `state` `state` ENUM('RELEASED','CUSTOM','MODULE','ARCHIVED','PENDING') NOT NULL DEFAULT 'RELEASED' COMMENT 'defines if an update is released or archived.' COLLATE 'utf8mb4_unicode_ci' AFTER `hash`;
|
||||
|
||||
ALTER TABLE `updates_include`
|
||||
CHANGE COLUMN `state` `state` ENUM('RELEASED','ARCHIVED','CUSTOM','PENDING') NOT NULL DEFAULT 'RELEASED' COMMENT 'defines if the directory contains released or archived updates.' COLLATE 'utf8mb4_unicode_ci' AFTER `path`;
|
||||
|
||||
DELETE FROM `updates_include` WHERE `path` = '$/data/sql/updates/pending_db_world';
|
||||
INSERT INTO `updates_include` (`path`, `state`) VALUES
|
||||
('$/data/sql/updates/pending_db_world', 'PENDING');
|
||||
@ -291,7 +291,7 @@ FlashAtStart = 1
|
||||
# DATABASE_CHARACTER = 2, // Character database
|
||||
# DATABASE_WORLD = 4, // World database
|
||||
#
|
||||
# Default: 7 - (All enabled)
|
||||
# Default: 7 - (All enabled)
|
||||
# 4 - (Enable world only)
|
||||
# 0 - (All disabled)
|
||||
|
||||
|
||||
@ -157,9 +157,7 @@ UpdateFetcher::DirectoryStorage UpdateFetcher::ReceiveIncludedDirectories() cons
|
||||
std::vector<std::string> moduleList;
|
||||
|
||||
for (auto const& itr : Acore::Tokenize(_modulesList, ',', true))
|
||||
{
|
||||
moduleList.emplace_back(itr);
|
||||
}
|
||||
|
||||
// data/sql
|
||||
for (auto const& itr : moduleList)
|
||||
@ -168,9 +166,7 @@ UpdateFetcher::DirectoryStorage UpdateFetcher::ReceiveIncludedDirectories() cons
|
||||
|
||||
Path const p(path);
|
||||
if (!is_directory(p))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
DirectoryEntry const entry = { p, AppliedFileEntry::StateConvert("MODULE") };
|
||||
directories.push_back(entry);
|
||||
@ -386,14 +382,14 @@ UpdateResult UpdateFetcher::Update(bool const redundancyChecks,
|
||||
// Apply default updates
|
||||
for (auto const& availableQuery : available)
|
||||
{
|
||||
if (availableQuery.second != CUSTOM && availableQuery.second != MODULE)
|
||||
if (availableQuery.second != PENDING && availableQuery.second != CUSTOM && availableQuery.second != MODULE)
|
||||
ApplyUpdateFile(availableQuery);
|
||||
}
|
||||
|
||||
// Apply only custom/module updates
|
||||
// Apply only pending/custom/module updates
|
||||
for (auto const& availableQuery : available)
|
||||
{
|
||||
if (availableQuery.second == CUSTOM || availableQuery.second == MODULE)
|
||||
if (availableQuery.second == PENDING || availableQuery.second == CUSTOM || availableQuery.second == MODULE)
|
||||
ApplyUpdateFile(availableQuery);
|
||||
}
|
||||
|
||||
|
||||
@ -72,6 +72,7 @@ private:
|
||||
{
|
||||
RELEASED,
|
||||
CUSTOM,
|
||||
PENDING,
|
||||
MODULE,
|
||||
ARCHIVED
|
||||
};
|
||||
@ -92,6 +93,8 @@ private:
|
||||
return RELEASED;
|
||||
else if (state == "CUSTOM")
|
||||
return CUSTOM;
|
||||
else if (state == "PENDING")
|
||||
return PENDING;
|
||||
else if (state == "MODULE")
|
||||
return MODULE;
|
||||
|
||||
@ -106,6 +109,8 @@ private:
|
||||
return "RELEASED";
|
||||
case CUSTOM:
|
||||
return "CUSTOM";
|
||||
case PENDING:
|
||||
return "PENDING";
|
||||
case MODULE:
|
||||
return "MODULE";
|
||||
case ARCHIVED:
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user