Remove old upgrade scripts
Hussayn Dabbous <[email protected]> Wed, 18 Feb 2009 14:28:44 -0800 (PST)
| Newsgroups | gmane.comp.java.scarab.devel |
|---|---|
| Message-ID | <[email protected]> |
Hi;
Up till today upgrading Scarab is a major task of its own. This is because
we never finished the database schema, which is not at all meant as critics.
But as a consequence, anybody upgrading from an older release typically
needs to also migrate the database to some extent. This migration could
be automated at least for the major supported databases which are
postgress and mysql to my knowledge.
But instead keeping the burden of supporting upgrades from nearly 8 years
ago
up till today (which afaik doesnt work anyways), we should make a cut here
and scrap the whole upgrade procedure and rewrite it in a cleaner way.
===============
Here is my proposal:
===============
1.) let release 0.22 be the last release which "supports" database
migrations
by the mechanism we have provided for the past years, namely
"during upgrade you need to run this and that script and hope it
works"
2.) in trunk, remove all older upgrade scripts and ant tasks (and maven
tasks?)
3.) Create a generic upgrade mechanism.
We have allready invented a name convention which i would modify
slightly:
- All database independent upgrade sripts need to be in src/sql/upgrade
- All database dependent scripts need to be in src/sql/<dbtype>/upgrade
- An upgrade-script use the name convention:
database dependent upgrade scripts:
src/sql/<dbtype>/upgrade/<from>/<descriptor>.sql
database independent upgrade scripts:
src/sql/upgrade/<from>/<descriptor>.sql
- If programatic data migration is needed:
java code for programatic data migrations:
src/java/org/tigris/scarab/upgrade/<from>/<Descriptor>[-seqno].java
src/java/org/tigris/scarab/upgrade/<dbtype>/<from>/<Descriptor>[-seqno].java
upgrade scripts can run in any order. If it is essential, that scripts
run in a given order,
the [seqno] must be used for those scripts, which need to run in a
given order. the [seqno]
is absolute in the sense that within one "upgrade/<from>" folder no 2
scripts may use the
same seqno. It is guaranteed that all scripts with [seqno] will run
BEFORE all other scripts
in the same folder.
- Add a table SCARAB_UPDATE_HISTORY containing:
ID integer
RELEASE varchar
FROM varchar
DESCRIPTOR varchar
TYPE integer (0:sql-script, 1:java-code)
DBSPECIFIC boolean (true: dbspecif task, false:dbindependent task)
STATUS varchar (scheduled | finished | <errorcode>)
EXECUTED date (execution date)
During an upgrade, a migrationwizzard runs and fills the
SCARAB_UPGRADE_HISTORY
with tasks and sets the status of each task to "scheduled".
Tasks will run in sequence, beginning at the lowest ID. the migration
wizzard takes
into account the previously introduced [seqno] to sort the tasks.
Only "scheduled" tasks and tasks with status=<errorcode> will be
performed.
The first failing task stops the migration.
When the migration is started over, it will continue after the last
successfully finished
task.
Scarab will only start normal operation, when all entries in the above
table are in status "finished"
complains, better ideas, discussion ?
give it to me ;-)
regards, hussayn
--
View this message in context: http://www.nabble.com/Remove-old-upgrade-scripts-tp22089758p22089758.html
Sent from the Scarab - Dev mailing list archive at Nabble.com.
------------------------------------------------------
http://scarab.tigris.org/ds/viewMessage.do?dsForumId=455&dsMessageId=1188422
To unsubscribe from this discussion, e-mail: [[email protected]].