databaseSchemaUpdate should not downgrade, it leads to inconsistent databases

Description

The activiti engine should never attempt a downgrade of the database, since this isn't really supported, and will lead to an inconsistent database.

After upgrading to 5.9, we accidentally started the Activiti Explorer from 5.8. The explorer immediately attempted a downgrade, presumably as follows:

  • Run the script "activiti.oracle.upgradestep.59.to.58.engine.sql", which doesn't exist, but doesn't fail

  • Changes the schema.version to "5.8", and updates schema.history (we get "create(5.8) upgrade(5.8->5.9) upgrade(5.9->5.8)")

From now on, the database is inconsistent. Starting the engine with upgrades turned on will discover that the current schema.version is 5.8, and attempt an upgrade to 5.8 to 5.9. This will then fail, since columns have already been added.

The solution would probably be to never allow a downgrade, but rather just fail. ("The database is already on a higher version").

Assignee

Frederik Heremans

Reporter

Eirik Lygre

Labels

None

Components

Fix versions

Priority

Major
Configure