fix(docker): Modules SQL do not get updated or populated for docker set ups (#19870)

* Added modules to dbimport so sql cab accessed by loader

* updated dbimport tools config option to enable module sql to be updated and populated

* Updated casting around GetOption and changed default to all
This commit is contained in:
Ben Carter 2024-09-06 11:37:00 -04:00 committed by GitHub
parent 9dae87595d
commit 6e5cd04591
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 27 additions and 2 deletions

View File

@ -199,6 +199,9 @@ ENV ACORE_COMPONENT=dbimport
COPY --chown=$DOCKER_USER:$DOCKER_USER \
data data
COPY --chown=$DOCKER_USER:$DOCKER_USER \
modules modules
COPY --chown=$DOCKER_USER:$DOCKER_USER\
--from=build \
/azerothcore/env/dist/bin/dbimport /azerothcore/env/dist/bin/dbimport

View File

@ -122,6 +122,8 @@ foreach(TOOL_NAME ${TOOLS_BUILD_LIST})
PUBLIC
database
PRIVATE
modules
scripts
acore-core-interface)
# Install config
@ -153,6 +155,8 @@ foreach(TOOL_NAME ${TOOLS_BUILD_LIST})
target_include_directories(${TOOL_PROJECT_NAME}
PUBLIC
${TOOL_PUBLIC_INCLUDES}
${CMAKE_SOURCE_DIR}/src
${CMAKE_SOURCE_DIR}/modules
PRIVATE
${CMAKE_CURRENT_BINARY_DIR}/${TOOL_NAME})

View File

@ -103,8 +103,15 @@ bool StartDB()
{
MySQL::Library_Init();
// Load databases
DatabaseLoader loader("dbimport");
// Load modules conditionally based on what modules are allowed to auto-update or none
std::string modules = sConfigMgr->GetOption<std::string>("Updates.AllowedModules", "all");
LOG_INFO("dbimport", "Loading modules: {}", modules.empty() ? "none" : modules);
DatabaseLoader loader =
modules.empty() ? DatabaseLoader("dbimport") :
(modules == "all") ? DatabaseLoader("dbimport", DatabaseLoader::DATABASE_NONE, AC_MODULES_LIST) :
DatabaseLoader("dbimport", DatabaseLoader::DATABASE_NONE, modules);
loader
.AddDatabase(LoginDatabase, "Login")
.AddDatabase(CharacterDatabase, "Character")

View File

@ -159,6 +159,17 @@ CharacterDatabase.SynchThreads = 1
Updates.EnableDatabases = 7
#
# Updates.AllowedModules
# Description: A list of modules that are allowed to be updated automatically by the DBImport tool.
# If the list is empty, no modules are allowed to automatically update. (current behavior)
# Default: "" - (No modules are allowed)
#
# Example: "mod_name,mod_name2,mod_name3" (selected modules)
# "all" - (All modules are allowed)
#
Updates.AllowedModules = "all"
#
# Updates.AutoSetup
# Description: Auto populate empty databases.