annotate 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
rev   line source
flickerstreak@211 1 local _, addonTable = ...
flickerstreak@211 2 local ReAction = addonTable.ReAction
flickerstreak@211 3
flickerstreak@211 4 ReAction.PROFILEVERSION_LATEST = 1
flickerstreak@211 5
flickerstreak@211 6 function ReAction:UpdateDB()
flickerstreak@211 7 local db = self.db
flickerstreak@211 8
flickerstreak@211 9 if not db.profile.dbversion then
flickerstreak@211 10 -- upgrade from legacy db to v1
flickerstreak@211 11
flickerstreak@211 12 -- (1) defaultBars table removed (pure cleanup, never used)
flickerstreak@211 13 db.profile.defaultBars = nil
flickerstreak@211 14
flickerstreak@211 15 -- (2) HideBlizzard is no longer a module
flickerstreak@211 16 local hdb = db:RegisterNamespace("HideBlizzard")
flickerstreak@211 17 if hdb then
flickerstreak@211 18 db.profile.options.hideBlizzardBars = hdb.profile.hide
flickerstreak@211 19 db.profile.options.hideBlizzardVehicleBar = hdb.profile.hideVehicle
flickerstreak@211 20 hdb:ResetProfile()
flickerstreak@211 21 end
flickerstreak@211 22
flickerstreak@211 23 db.profile.dbversion = 1
flickerstreak@211 24 end
flickerstreak@211 25
flickerstreak@211 26 db.profile.dbversion = self.PROFILEVERSION_LATEST
flickerstreak@211 27 end