|Go to Page...|
|Thread Tools||Display Modes|
|11-09-20, 09:56 PM||#1|
A Wyrmkin Dreamwalker
Hi all. I'm wondering if anyone can explain the proper way to handle database restructures when using AceDB. I'm wanting to release an alpha version of an add-on I'm working on but I want to make sure stable databases are not lost. In my current development version I've restructured the database.
I am not ready to convert stable DBs into the new one yet, so the plan is to save a backup of the stable db when someone uses the alpha. However I want to be able to restore the stable db if they decide they don't wanna deal with the alpha and revert back to stable.
I've managed to save a backup of the stable db fine but I'm having issues restoring it in the stable version.
I was able to have it write the user saved data, but I get errors until a reload. I think it's because I'm using "**" in my defaults DB and when I manually add the saved data it's not linked to that. I then tried to set it as a metatable but it didn't work. Then my lunch break was over so that was all I could see from there.
Anyway this whole process has just seemed way too complicated for something that was so easy before I used AceDB (save a backup and just rewrite). I'm wondering if there's something I'm missing that would make this process a lot simpler?
Or is it just because am doing the metatables wrong?
As I'm on my phone now I can't really show the code and I didn't commit it before I left but if it's needed I can show when I get home.
Issue is with the char DB. I have a table inside it called bars and then a table nested in that with the "**" key and another table inside that with another "**".
So I tried after writing the saved data to set it like
That just being pseudocode but that was what didn't work. And I did the same with the nested "**"
Edit: this is what I've got so far, and the problem with it is that it's only saving the values for items that are in the default and not also the ones in the saved. I don't know if I'm just missing something because I'm tired or what.
Seeing as I've had no responses so far and I've come up with something that... works, I'll post it here in case it helps anyone else. But I still wonder if there's a better way to do this. I feel like this solution is a bit messy (but also it's just a quick fix to a temporary problem anyway so I'm not that concerned).
Last edited by Niketa : 11-12-20 at 09:30 AM. Reason: Added "solution"
|WoWInterface » Developer Discussions » Lua/XML Help » AceDB help|