use of com.djrapitops.plan.storage.database.transactions.init.OperationCriticalTransaction in project Plan by plan-player-analytics.
the class SQLDB method setupDatabase.
/**
* Ensures connection functions correctly and all tables exist.
* <p>
* Updates to latest schema.
*/
private void setupDatabase() {
executeTransaction(new OperationCriticalTransaction() {
@Override
protected void performOperations() {
logger.info(locale.getString(PluginLang.DB_SCHEMA_PATCH));
}
});
executeTransaction(new CreateTablesTransaction());
for (Patch patch : patches()) {
executeTransaction(patch);
}
executeTransaction(new OperationCriticalTransaction() {
@Override
protected void performOperations() {
logger.info(locale.getString(PluginLang.DB_APPLIED_PATCHES));
if (getState() == State.PATCHING)
setState(State.OPEN);
}
});
registerIndexCreationTask();
}
Aggregations