Fix schema migration that creates index for submodule subscriptions

Commit b0d373c272 added a schema
migration that creates an index for submodule subscriptions.
This migration fails if the index already exists. This can be if the
site was newly created after the submodule subscription feature
(d15704079c) was introduced or if the
missing index was created manually.

This change fixes the migration by catching any SQLException when
trying to create the index and asking the user whether this exception
should be ignored. An automatic decision is not possible since specific
SQL error codes for this case are not available for all supported
databases.

Change-Id: I7ecb3f0ed050f22753d268dcac01ca3bdb2d84b3
Signed-off-by: Edwin Kempin <edwin.kempin@sap.com>
This commit is contained in:
Edwin Kempin
2012-05-25 14:00:11 +02:00
parent f87fe87c16
commit 5e43e77ab5
4 changed files with 30 additions and 0 deletions

View File

@@ -190,6 +190,11 @@ public class Init extends SiteProgram {
return ui.yesno(def, msg);
}
@Override
public boolean isBatch() {
return ui.isBatch();
}
@Override
public void pruneSchema(StatementExecutor e, List<String> prune) {
for (String p : prune) {