Schema_152 + Schema_157: Ignore missing index

We want to drop the index. If it is already gone it is also fine.
On upgrade of my test site these schema migrations failed because the
index was missing. In other schema migrations (e.g. Schema_145) we
handle missing indexes the same way.

Change-Id: I5d26634b08fb8b6852e0fe2303d2f851c650f29b
Signed-off-by: Edwin Kempin <ekempin@google.com>
This commit is contained in:
Edwin Kempin 2017-09-30 10:21:48 +02:00
parent d1251e5512
commit 26c4847e26
2 changed files with 4 additions and 0 deletions

View File

@ -36,6 +36,8 @@ public class Schema_152 extends SchemaVersion {
SqlDialect dialect = schema.getDialect();
try (StatementExecutor e = newExecutor(db)) {
dialect.dropIndex(e, "accounts", "accounts_byFullName");
} catch (OrmException ex) {
// Ignore. The index did not exist.
}
}
}

View File

@ -36,6 +36,8 @@ public class Schema_157 extends SchemaVersion {
SqlDialect dialect = schema.getDialect();
try (StatementExecutor e = newExecutor(db)) {
dialect.dropIndex(e, "accounts", "accounts_byPreferredEmail");
} catch (OrmException ex) {
// Ignore. The index did not exist.
}
}
}