Paragon: move module SQL to AC's data/sql/db-* layout for auto-update
AzerothCore's DBUpdater scans modules/<mod>/data/sql/db-{world,characters,auth}/
(see src/server/database/Updater/UpdateFetcher.cpp). The previous
modules/mod-paragon/sql/{world,characters}/base/ layout was non-standard
and skipped by the updater, so a fresh deploy never had Paragon tables
created automatically.
Move all five SQL files into the standard layout. Files are idempotent
(CREATE TABLE IF NOT EXISTS plus a DELETE+INSERT for the cost table)
and now apply on every dbimport / worldserver start, recorded by hash
in <db>.updates so re-runs are skipped.
Update BUILD-NATIVE.md to drop the manual mysql import section, and
document the SQL layout in the mod-paragon README.
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
+11
-14
@@ -172,22 +172,19 @@ The standard AzerothCore three-database layout (`acore_auth`,
|
||||
|
||||
Easiest path: run the worldserver once with empty databases and let
|
||||
`AC_FORCE_CREATE_DB=1` populate them, **or** use `dbimport` from the
|
||||
install dir. Then layer the Fractured-specific SQL on top:
|
||||
install dir.
|
||||
|
||||
```bash
|
||||
cd <repo>/modules/mod-paragon/sql
|
||||
The Fractured-specific SQL (mod-paragon) lives under
|
||||
`modules/mod-paragon/data/sql/db-{world,characters}/base/` — that's the
|
||||
**AzerothCore-standard module layout**, which means AC's built-in
|
||||
DBUpdater picks it up automatically on every `worldserver` /
|
||||
`dbimport` start. New SQL files are applied; previously-applied ones
|
||||
are skipped via the hash recorded in `acore_world.updates` /
|
||||
`acore_characters.updates`. No manual `mysql < ...` steps required for
|
||||
deploys.
|
||||
|
||||
# world DB
|
||||
mysql -u acore -p acore_world < world/base/paragon_gametables.sql
|
||||
mysql -u acore -p acore_world < world/base/paragon_spell_ae_cost.sql
|
||||
mysql -u acore -p acore_world < world/base/player_class_stats_paragon_basemana.sql
|
||||
|
||||
# characters DB
|
||||
mysql -u acore -p acore_characters < characters/base/character_paragon_currency.sql
|
||||
```
|
||||
|
||||
Re-run any module-specific SQL whenever you pull updates that touch
|
||||
`modules/*/sql/`.
|
||||
Modify-and-redeploy works the same way: change the file, push, pull on
|
||||
the VPS, and the next `dbimport` run sees the new hash and re-applies.
|
||||
|
||||
---
|
||||
|
||||
|
||||
@@ -30,3 +30,14 @@ Auto-detected by `modules/CMakeLists.txt` (`GetModuleSourceList` globs
|
||||
every subdirectory). No additional CMake plumbing is needed; rebuild
|
||||
the worldserver image and the loader symbol `Addmod_paragonScripts`
|
||||
gets linked into the static `modules` target.
|
||||
|
||||
## SQL layout
|
||||
|
||||
SQL files live under `data/sql/db-world/base/` and
|
||||
`data/sql/db-characters/base/` — the standard AzerothCore module path
|
||||
that the built-in DBUpdater scans (see
|
||||
`src/server/database/Updater/UpdateFetcher.cpp`). Files placed there
|
||||
are applied automatically by `worldserver` / `dbimport` on startup and
|
||||
recorded by hash in the `updates` table of the target database, so
|
||||
re-runs are idempotent. Any new SQL added under those directories will
|
||||
be picked up on the next container/server start without manual import.
|
||||
|
||||
Reference in New Issue
Block a user