diff --git a/.env.example b/.env.example index 4c40499..8fe4826 100644 --- a/.env.example +++ b/.env.example @@ -125,6 +125,11 @@ ACORE_PLAYERBOTS_FORCE=0 # Скрипт импортирует только отсутствующие таблицы и world-объекты, не перезатирая уже созданные данные. ACORE_IMPORT_MYTHICPLUS_SQL=1 +# 1 = импортировать SQL для lua_scripts/Store_System в отдельную базу `store`. +# Скрипт создаст схему `store`, недостающие таблицы и стартовые записи магазина. +# Демонстрационные старые логи покупок из исходного дампа не импортируются. +ACORE_IMPORT_STORE_SQL=1 + # ------------------------------------------------------------------------------ # worldserver.conf: управляемые override-настройки # ------------------------------------------------------------------------------ diff --git a/import-custom-sql.sh b/import-custom-sql.sh index 8a00093..0efc158 100644 --- a/import-custom-sql.sh +++ b/import-custom-sql.sh @@ -13,13 +13,14 @@ if [[ -f "$ENV_FILE" ]]; then fi IMPORT_MYTHICPLUS_SQL="${ACORE_IMPORT_MYTHICPLUS_SQL:-1}" +IMPORT_STORE_SQL="${ACORE_IMPORT_STORE_SQL:-1}" usage() { cat < "$temp_sql" + + log "bootstrapping store database" + mysql_exec "" "$(cat "$temp_sql")" + rm -f "$temp_sql" +} + if (($# > 0)); then case "$1" in -h|--help) @@ -98,6 +231,7 @@ if (($# > 0)); then fi require_integer_flag "ACORE_IMPORT_MYTHICPLUS_SQL" "$IMPORT_MYTHICPLUS_SQL" +require_integer_flag "ACORE_IMPORT_STORE_SQL" "$IMPORT_STORE_SQL" cd "$ROOT_DIR" @@ -106,36 +240,7 @@ if ! docker compose ps --status running --services | grep -qx 'ac-database'; the exit 1 fi -if [[ "$IMPORT_MYTHICPLUS_SQL" == "0" ]]; then - log "MythicPlus SQL import disabled, skipped" - exit 0 -fi - -if [[ ! -d "$ROOT_DIR/sql/Mythic+" ]]; then - log "sql/Mythic+ directory not found, skipped" - exit 0 -fi - -maybe_import_table "acore_characters" "character_mythic_history" \ - "$ROOT_DIR/sql/Mythic+/characters/character_mythic_history.sql" -maybe_import_table "acore_characters" "character_mythic_keys" \ - "$ROOT_DIR/sql/Mythic+/characters/character_mythic_keys.sql" -maybe_import_table "acore_characters" "character_mythic_rating" \ - "$ROOT_DIR/sql/Mythic+/characters/character_mythic_rating.sql" -maybe_import_table "acore_characters" "character_mythic_vault" \ - "$ROOT_DIR/sql/Mythic+/characters/character_mythic_vault.sql" -maybe_import_table "acore_characters" "character_mythic_weekly_affixes" \ - "$ROOT_DIR/sql/Mythic+/characters/character_mythic_weekly_affixes.sql" - -maybe_import_table "acore_world" "world_mythic_loot" \ - "$ROOT_DIR/sql/Mythic+/world/world_mythic_loot.sql" -maybe_import_table "acore_world" "world_vault_loot" \ - "$ROOT_DIR/sql/Mythic+/world/world_vault_loot.sql" - -if [[ "$(mysql_query "acore_world" "SELECT COUNT(*) FROM creature_template WHERE entry = 900001;")" == "0" ]]; then - import_sql_file "acore_world" "$ROOT_DIR/sql/Mythic+/world/creature_and_keystones.sql" -else - log "MythicPlus creature bootstrap already exists, skipping" -fi +import_mythicplus_sql +import_store_sql log "custom SQL bootstrap completed"