DB/Structure

* fix data types and data length and add default values where necessary
 * data should no longer get truncated
 * misc fixes
This commit is contained in:
Sarjuuk
2024-05-22 17:53:31 +02:00
parent 7d5930865c
commit f6565ea924
15 changed files with 1980 additions and 2003 deletions

View File

@@ -266,7 +266,7 @@ class RemoteArenaTeamList extends ArenaTeamList
// basic arena team data
foreach (Util::createSqlBatchInsert($data) as $ins)
DB::Aowow()->query('INSERT IGNORE INTO ?_profiler_arena_team (?#) VALUES '.$ins, array_keys(reset($data)));
DB::Aowow()->query('INSERT INTO ?_profiler_arena_team (?#) VALUES '.$ins.' ON DUPLICATE KEY UPDATE `id` = `id`', array_keys(reset($data)));
// merge back local ids
$localIds = DB::Aowow()->selectCol(

View File

@@ -251,7 +251,7 @@ class RemoteGuildList extends GuildList
// basic guild data
foreach (Util::createSqlBatchInsert($data) as $ins)
DB::Aowow()->query('INSERT IGNORE INTO ?_profiler_guild (?#) VALUES '.$ins, array_keys(reset($data)));
DB::Aowow()->query('INSERT INTO ?_profiler_guild (?#) VALUES '.$ins.' ON DUPLICATE KEY UPDATE `id` = `id`', array_keys(reset($data)));
// merge back local ids
$localIds = DB::Aowow()->selectCol(

View File

@@ -687,7 +687,7 @@ class RemoteProfileList extends ProfileList
if ($guildData)
{
foreach (Util::createSqlBatchInsert($guildData) as $ins)
DB::Aowow()->query('INSERT IGNORE INTO ?_profiler_guild (?#) VALUES '.$ins, array_keys(reset($guildData)));
DB::Aowow()->query('INSERT INTO ?_profiler_guild (?#) VALUES '.$ins.' ON DUPLICATE KEY UPDATE `id` = `id`', array_keys(reset($guildData)));
// merge back local ids
$localGuilds = DB::Aowow()->selectCol('SELECT realm AS ARRAY_KEY, realmGUID AS ARRAY_KEY2, id FROM ?_profiler_guild WHERE realm IN (?a) AND realmGUID IN (?a)',

View File

@@ -43,7 +43,7 @@ class SoundList extends BaseType
if ($this->fileBuffer)
{
$files = DB::Aowow()->select('SELECT id AS ARRAY_KEY, `id`, `file` AS title, `type`, `path` FROM ?_sounds_files sf WHERE id IN (?a)', array_keys($this->fileBuffer));
$files = DB::Aowow()->select('SELECT id AS ARRAY_KEY, `id`, `file` AS title, CAST(`type` AS UNSIGNED) AS type, `path` FROM ?_sounds_files sf WHERE id IN (?a)', array_keys($this->fileBuffer));
foreach ($files as $id => $data)
{
// 3.3.5 bandaid - need fullpath to play via wow API, remove for cata and later

View File

@@ -1605,7 +1605,7 @@ class SpellList extends BaseType
// step 0: get text
$data = $this->getField($type, true);
if (empty($data) || $data == "[]") // empty tooltip shouldn't be displayed anyway
return ['', []];
return ['', [], false];
// step 1: if the text is supplemented with text-variables, get and replace them
if ($this->curTpl['spellDescriptionVariableId'] > 0)
@@ -1706,7 +1706,7 @@ class SpellList extends BaseType
$data = strtr($data, ["\r" => '', "\n" => '<br />']);
// cache result
$this->parsedText[$this->id][$type][User::$localeId][$this->charLevel][(int)$this->interactive] = [$data, $relSpells];
$this->parsedText[$this->id][$type][User::$localeId][$this->charLevel][(int)$this->interactive] = [$data, $relSpells, $this->scaling[$this->id]];
return [$data, $relSpells, $this->scaling[$this->id]];
}