[10254] Remove dependence auction data from auctioneer guid.

* Field `auctioneerguid` replaced by `houseid` and table reanmed to `auction`
  (it list auctions and `id` is auction id).
* Update related code.

* SQL update fill `houseid` field by old `auctioneerguid`
  BUT: SQL update expect that you world DB named `mangos`.
  If this not true for your case you need modify SQL update BEFORE APPLY
  in 2 placed in part "mangos.creature AS c, mangos.creature_template AS ct"

* Another small possitive result: now possible easy select auctions related
  to some auction store (1-3 is one team actions, 4-6 another team auction,
  and 7 is neutral auction store for both teams
This commit is contained in:
VladimirMangos 2010-07-24 01:38:09 +04:00
parent 6c6ce87867
commit e3befa2072
10 changed files with 54 additions and 39 deletions

View file

@ -5858,7 +5858,7 @@ void ObjectMgr::SetHighestGuids()
// Cleanup other tables from not existed guids (>=m_hiItemGuid)
CharacterDatabase.PExecute("DELETE FROM character_inventory WHERE item >= '%u'", m_ItemGuids.GetNextAfterMaxUsed());
CharacterDatabase.PExecute("DELETE FROM mail_items WHERE item_guid >= '%u'", m_ItemGuids.GetNextAfterMaxUsed());
CharacterDatabase.PExecute("DELETE FROM auctionhouse WHERE itemguid >= '%u'", m_ItemGuids.GetNextAfterMaxUsed());
CharacterDatabase.PExecute("DELETE FROM auction WHERE itemguid >= '%u'", m_ItemGuids.GetNextAfterMaxUsed());
CharacterDatabase.PExecute("DELETE FROM guild_bank_item WHERE item_guid >= '%u'", m_ItemGuids.GetNextAfterMaxUsed());
result = WorldDatabase.Query("SELECT MAX(guid) FROM gameobject" );
@ -5868,7 +5868,7 @@ void ObjectMgr::SetHighestGuids()
delete result;
}
result = CharacterDatabase.Query("SELECT MAX(id) FROM auctionhouse" );
result = CharacterDatabase.Query("SELECT MAX(id) FROM auction" );
if( result )
{
m_AuctionIds.Set((*result)[0].GetUInt32()+1);