Ralf wrote: ↑Thu Jan 25, 2018 1:48 pmRunning your script deletes exisitng database and makes a new one or updates an existing database?
The script don't delete anything, but it assumes ZXDB tables don't exist, or they are all empty.
Technically the "incremental" scripts in ZXDB were originally intended to allow people update their database copy without recreating anything. However it was too much work to maintain them this way, and nobody was benefiting from them, so they don't work this way anymore. Although "incremental" scripts still exist, now they only serve the purpose of "auditing" (so anyone can see and help validate every correction and addition made to the original WoS content).
Ralf wrote: ↑Thu Jan 25, 2018 1:48 pmif I create some sql views and other changes in my database and later run the latest update script I'll lose my changes, right?
If you delete data from all ZXDB tables, then run the ZXDB script, these tables will be repopulated with latest ZXDB content without losing your views. However if you made changes to ZXDB tables content, they would be lost. Notice that there's not much I could do to help you in this latter case. Even if I provided a separate script containing only the ZXDB changes, there's always the chance that a certain ZXDB update will override exactly the information you previously changed yourself...
My suggestion is, write instead your own script to create views and whatever other changes you want. Whenever there's a new ZXDB update, you can simply drop the entire database, run the latest ZXDB script, then run your own script afterwards. This is exactly how ZX Pokemaster build works now, I suggest you take a look at its source code.