database-schema
Database Schema
Please note that while this schema is accessible globally, whenever possible the API should be used to access these data rather than manipulating the entries directly.
The schema will be best described with an example.
Socialist.whodb = { [1] = { ["id"] = 1, ["name"] = "Martin", ["normalname"] = "Martin", ["guild"] = "The Aristocrats", ["normalguild"] = "TheAristocrats", ["level"] = 64, ["class"] = "Mage", ["race"] = "Gnome", ["lastseen"] = 1118722038, ["zone"] = "General - Stormwind City", }, [2] = { ["id"] = 2, ["name"] = "Thömas", ["normalname"] = "Thomas", ["guild"] = "P A N D E M I C", ["normalguild"] = "PANDEMIC", ["level"] = 80, ["class"] = "Death knight", ["race"] = "Human", ["lastseen"] = 1118726233, ["zone"] = "Ulduar", ["talents"] = { [1] = 61, [2] = 5, [3] = 5, }, }, } Socialist.groupdb = { [1] = { ["id"] = 1, ["date"] = 1118726204, ["players"] = { [1] = 51, [2] = 122, [3] = 48, [4] = 3, [5] = 127, [6] = 264, [7] = 223, [8] = 623, [9] = 289, [10] = 58, }, ["instances"] = { [1] = "Ulduar", }, ["raidids"] = { [1] = 110249, }, }, [2] = { ["id"] = 2, ["date"] = 1118725621, ["players"] = { [1] = 63, [2] = 458, [3] = 311, [4] = 287, [5] = 122, }, ["instances"] = { [1] = "Utgarde Pinnacle", [2] = "Utgarde Keep", }, ["raidids"] = nil, }, } Socialist.profdb = { [1] = { ["id"] = 1, ["name"] = "Delicate Copper Wire", ["profession"] = "Jewelcrafting", ["mats"] = { ["Copper Bar"] = 2, }, ["crafters"] = { [1] = 6, [2] = 422, [3] = 532, [4] = 923, }, }, }
Field Value Descriptions
Field value descriptions for WhoDB
- ["id"] - A unique and permanent number identifying that entry. Note that by default the first record is given 1, the second 2, and so on, but this does not necessarily hold. Entries may be deleted, reducing the index of every entry that preceded it. However, the ["id"] will always be the same. (The last assigned id can be found at Socialist.whodb["last id"]).
- ["name"] - The exact name of the assosciated player. This SHOULD be unique, as returned by UnitName(unit). In the case of cross-realm players, this should be done as follows: "Frodo-Deathwing" (the hyphen indicating a break between the player's name and the server's name). This will maintain name uniqueness in the case of cross-realm situations such as during a battleground.
- ["normalname"] - This field, automatically generated from the ["name"] field, is a translation in which "abnormal" or accented characters are substituted for their ASCII equivalents. An example would be that "Töm" will be 'normalized' to "Tom". Note that this convention may be undesirable for other alphabets, and in the future will be toggle-able.
- ["guild"] - The exact name of the character's guild. If the character is not in a guild, this field will be left "nil".
- ["normalguild"] - See "normalname".
- ["level"] - the level of the character. If no level is known, will be left "nil".
- ["class"] - The class of the character. If no class is knowm, will be left "nil".
- ["race"] - The race of the character. if no race is known, will be left "nil".
- ["lastseen"] - The time of the last modification to this entry, recorded automatically via the time() function (in seconds).
- ["zone"] - Normally, the zone in which the last modification to this entry was prompted from. In cases, this could be not a game zone, but rather something else like the chat channel in which the character was heard.
- ["talents"] - A table with three numerically indexed elements corresponding to the first, second, and third talent trees. Each element stores a number, being the number of talents spent in that tree. If talent information is not known, the entire table will be left nil. Characters below level 10 will also have the entire table left nil.
Field value descriptions for GroupDB
- ["id"] - See WhoDB ["id"]
- ["date"] - The time() at which the group started.
- ["players"] - A numerically indexed array, listing every player that was in the group. Each player is identified by his or her corresponding ["id"] from WhoDB.
- ["instances"] - A numerically indexed array, listing the name of every instance the group visited.
- ["raidids"] - A numerically indexed array, listing the RaidID numbers that were updated, added, or otherwise changed during the group.
Field value descriptions for ProfDB
- ["id"] - See WhoDB ["id"]
- ["name"] - The name of a craftable item.
- ["profession"] - The name of the profession that crafts this item.
- ["mats"] - Table. The keys are the names of materials which are required to craft the item. The values are the number of that item that are needed to craft it.
- ["crafters"] - A numerically indexed array of the people who can craft the item. The values are the WhoDB ["id"]s that correspond to the crafters.
Comments