There is an item 'Procedural language / script language (Javascript)'
on the roadmap (priority 2):
http://groups.google.com/group/h2-database/web/roadmap
I think the easiest way to solve your problem is using constructs like:
SET @VERSION=SELECT VALUE FROM SETTINGS WHERE KEY='version';
IF @VERSION<=1 THEN
... script to upgrage from version 1 to version 2 ...
END
IF @VERSION<=2 THEN
... script to upgrage from version 2 to version 3 ...
END
Otherwise you will have to repeat IF EXISTS for each statement. So far
I am not sure how this procedural language should look like. More like
PostgreSQL / Oracle, Microsoft SQL Server, or MySQL. Probably it will
be something simpler and less verbose (with the option to support
compatibility with other databases later on if required). A converter
from PL/SQL / T-SQL to Java would make sense as well, and the ability
to directly compile and execute Java code inside H2 (but there are
security risks).
Regards,
Thomas