fix #1825 upgrade from 12.2

This commit is contained in:
Shinsuke Sugaya 2018-09-01 19:00:46 +09:00
parent 0d52ef5f52
commit ef5efb9059
2 changed files with 21 additions and 0 deletions

View file

@ -50,6 +50,8 @@ public class AdminUpgradeAction extends FessAdminAction {
private static final String VERSION_12_1 = "12.1";
private static final String VERSION_12_2 = "12.2";
// ===================================================================================
// Attribute
//
@ -124,6 +126,7 @@ public class AdminUpgradeAction extends FessAdminAction {
try {
upgradeFrom12_0();
upgradeFrom12_1();
upgradeFrom12_2();
upgradeFromAll();
saveInfo(messages -> messages.addSuccessStartedDataUpdate(GLOBAL));
@ -136,6 +139,7 @@ public class AdminUpgradeAction extends FessAdminAction {
} else if (VERSION_12_1.equals(form.targetVersion)) {
try {
upgradeFrom12_1();
upgradeFrom12_2();
upgradeFromAll();
saveInfo(messages -> messages.addSuccessStartedDataUpdate(GLOBAL));
@ -145,6 +149,18 @@ public class AdminUpgradeAction extends FessAdminAction {
logger.warn("Failed to upgrade data.", e);
saveError(messages -> messages.addErrorsFailedToUpgradeFrom(GLOBAL, VERSION_12_1, e.getLocalizedMessage()));
}
} else if (VERSION_12_2.equals(form.targetVersion)) {
try {
upgradeFrom12_2();
upgradeFromAll();
saveInfo(messages -> messages.addSuccessStartedDataUpdate(GLOBAL));
systemHelper.reloadConfiguration();
} catch (final Exception e) {
logger.warn("Failed to upgrade data.", e);
saveError(messages -> messages.addErrorsFailedToUpgradeFrom(GLOBAL, VERSION_12_2, e.getLocalizedMessage()));
}
} else {
saveError(messages -> messages.addErrorsUnknownVersionForUpgrade(GLOBAL));
}
@ -165,6 +181,10 @@ public class AdminUpgradeAction extends FessAdminAction {
"{\"properties\":{\"urlId\":{\"type\":\"keyword\"}}}");
}
private void upgradeFrom12_2() {
// nothing
}
private void upgradeFromAll() {
// nothing
}

View file

@ -46,6 +46,7 @@
<la:select styleId="targetVersion" property="targetVersion" styleClass="form-control">
<la:option value="12.0">12.0</la:option>
<la:option value="12.1">12.1</la:option>
<la:option value="12.2">12.2</la:option>
</la:select>
</div>
</div>