On 2015-10-01 01:08 AM, eluken at pentarch.org wrote:
> Well, when you put it like that :)
>
> I might allow the user to change the name based on the game name. But 
> there again, special characters.  Ideally, the functionality would 
> allow for multiple databases.
>
> I also need to figure out how to upgrade the database when I have a 
> database upgrade, and maintain current data.  That is probably just a 
> series of SQL commands creating temp tables and copying the new 
> structure over.

Yep. Should be that easy. Just make, debug and test your scripts well 
before releasing them - and be sure the DB's against which they run are 
version-checked so that script for upgrading version 3 to version 4 
doesn't get run on a version 1, 2 or 5 DB file.
In my systems mostly I add SQL for upgrading every version to the next, 
so whatever version DB I encounter (and as long as I can deduce which 
version DB it is), I can simply walk it through the upgrades until the 
version is current.

You can use PRAGMA user_version, see:
https://www.sqlite.org/pragma.html#pragma_schema_version

>
> On a slight tangent, is there a way to verify database integrity?

https://www.sqlite.org/faq.html#q21
https://www.sqlite.org/pragma.html#pragma_quick_check
https://www.sqlite.org/pragma.html#pragma_integrity_check


Reply via email to