comparison UpdateDB.lua @ 211:97949dbe987f

Demodularize HideBlizzard - added framework for updating profile database - removed unused profile.defaultBars[]
author Flick <flickerstreak@gmail.com>
date Thu, 18 Nov 2010 12:59:00 -0800
parents
children
comparison
equal deleted inserted replaced
207:c24ac8ee1e45 211:97949dbe987f
1 local _, addonTable = ...
2 local ReAction = addonTable.ReAction
3
4 ReAction.PROFILEVERSION_LATEST = 1
5
6 function ReAction:UpdateDB()
7 local db = self.db
8
9 if not db.profile.dbversion then
10 -- upgrade from legacy db to v1
11
12 -- (1) defaultBars table removed (pure cleanup, never used)
13 db.profile.defaultBars = nil
14
15 -- (2) HideBlizzard is no longer a module
16 local hdb = db:RegisterNamespace("HideBlizzard")
17 if hdb then
18 db.profile.options.hideBlizzardBars = hdb.profile.hide
19 db.profile.options.hideBlizzardVehicleBar = hdb.profile.hideVehicle
20 hdb:ResetProfile()
21 end
22
23 db.profile.dbversion = 1
24 end
25
26 db.profile.dbversion = self.PROFILEVERSION_LATEST
27 end