DB/Structure

* implemented changed from 309a7f7e2a (achievement reward mail localization)
This commit is contained in:
Sarjuuk
2017-05-04 20:56:55 +02:00
parent 7c456b970c
commit 4a8fe6de7d
6 changed files with 35 additions and 19 deletions

View File

@@ -531,9 +531,9 @@ function source(array $ids = [])
it.class, it.subclass, it.spellid_1, it.spelltrigger_1, it.spellid_2, it.spelltrigger_2,
COUNT(1) AS qty
FROM (
SELECT IFNULL(IF(mlt.Reference > 0, -mlt.Reference, mlt.Item), ar.item) AS item, ar.entry
FROM achievement_reward ar LEFT JOIN mail_loot_template mlt ON mlt.entry = ar.mailTemplate
WHERE ar.mailTemplate > 0 OR ar.item > 0
SELECT IFNULL(IF(mlt.Reference > 0, -mlt.Reference, mlt.Item), ar.ItemID) AS item, ar.ID AS entry
FROM achievement_reward ar LEFT JOIN mail_loot_template mlt ON mlt.entry = ar.MailTemplateID
WHERE ar.MailTemplateID > 0 OR ar.ItemID > 0
) src
LEFT JOIN
item_template it ON src.item = it.entry
@@ -1186,10 +1186,10 @@ function source(array $ids = [])
# 12: Achievement
CLISetup::log(' * #12 Achievement');
$sets = DB::World()->select('
SELECT titleId AS ARRAY_KEY, MIN(entry) AS srcId, NULLIF(MAX(entry), MIN(entry)) AS altSrcId FROM (
SELECT title_A as `titleId`, entry FROM achievement_reward WHERE title_A <> 0
SELECT titleId AS ARRAY_KEY, MIN(ID) AS srcId, NULLIF(MAX(ID), MIN(ID)) AS altSrcId FROM (
SELECT TitleA AS `titleId`, ID FROM achievement_reward WHERE TitleA <> 0
UNION
SELECT title_H as `titleId`, entry FROM achievement_reward WHERE title_H <> 0
SELECT TitleH AS `titleId`, ID FROM achievement_reward WHERE TitleH <> 0
) AS x GROUP BY titleId'
);
foreach ($sets as $tId => $set)

View File

@@ -74,7 +74,7 @@ function titles()
// update side
$questInfo = DB::World()->select($questQuery);
$sideUpd = DB::World()->selectCol('SELECT IF (title_A, title_A, title_H) AS ARRAY_KEY, BIT_OR(IF(title_A, 1, 2)) AS side FROM achievement_reward WHERE (title_A <> 0 AND title_H = 0) OR (title_H <> 0 AND title_A = 0) GROUP BY ARRAY_KEY HAVING side <> 3');
$sideUpd = DB::World()->selectCol('SELECT IF(TitleA, TitleA, TitleH) AS ARRAY_KEY, BIT_OR(IF(TitleA, 1, 2)) AS side FROM achievement_reward WHERE (TitleA <> 0 AND TitleH = 0) OR (TitleH <> 0 AND TitleA = 0) GROUP BY ARRAY_KEY HAVING side <> 3');
foreach ($questInfo as $tId => $data)
{
if ($data['eventEntry'])

View File

@@ -0,0 +1 @@
UPDATE aowow_dbversion SET `sql` = CONCAT(IFNULL(`sql`, ''), ' source titles');