port over some changes from Trinity version including one possible memory leak fix
[AHbot.git] / sql / updates / README
blobfd1a2d1c17b040530223c1328c82ff0d196702ee
1 = MaNGOS -- README =
3 Copyright (c) 2005-2009 MaNGOS <http://getmangos.com/>
5 See the COPYING file for copying conditions.
7 == Database Updates ==
8 This folder contains SQL files which will apply required updates to your MySQL
9 database, whenever the MaNGOS database structure has been changed or extended.
11 To see if you need an update, the file names have been given a fixed structure
12 that should enable you to see if you need an update or not.
14 === File name descriptin ===
15 File names are divided into two parts. First part is the revision+counter
16 that show commit revision that will be compatible with database after apply update.
17 Counter set order in sql updates apply for same revision.
18 The second part of the name of the database and the table that needs and update or has been added.
19 See an example below:
21          6936_01_mangos_spell_chain.sql
22          |    |  |      |
23          |    |  |      |
24          |    |  |      The table `spell_chain`
25          |    |  |      will need an update.
26          |    |  |
27          |    |  Name of affected DB (default recommended name)
28          |    |  Can be: characters, mangos, realmd
29          |    |
30          |    Counter show number of sql update in updates list for provided revision
31          |    and set proper order for sql updates for same revision
32          |
33          MaNGOS commit revison related to sql update.
34          It included in commit description in form [6936] as you can see at http://github.com/mangos/mangos/commits/master
36 After appling this update DB compatiable with database that include this sql update.
37 SQL update include special protection against multiply and wrong order SQL updates apply.
38 So attempt apply sql update to more old DB without previous SQL update in list for targeted database
39 or to DB with already applied this or later SQL update will generate error and not applied.
41 === For commiters ====
43 MaNGOS sources include special tool ( contrib/git_id ) for generation revision info
44 in commit notes and in src/shared/revision_nr.h file. It have option '-s' that let set
45 correct sql update names with revision number, generate sql update order guard queries,
46 and update version fields in mangos.sql/etc. For it use name sql updates in form
47 01_mangos_spell_chain.sql or 9999_01_mangos_spell_chain.sql (counter can be _01_, _02_, and etc,
48 dependent from sql updates amount in commit) and _not_ add to sql updates
49 guard queries. Include sql updates in commit. After commit adding to local repo call git_id
50 with -s option (and another, note: -s option not work propertly with -l option). Other steps
51 tool will do by self and apply changes to commit. After tool use commit with sql updates ready
52 to push.