提交 a1af0259 authored 作者: christian.peter.io's avatar christian.peter.io

Automatic database upgrade from non page store is now possible

上级 1fa6c83d
...@@ -13,6 +13,7 @@ import java.sql.SQLException; ...@@ -13,6 +13,7 @@ import java.sql.SQLException;
import java.sql.Statement; import java.sql.Statement;
import java.util.Properties; import java.util.Properties;
import org.h2.message.DbException; import org.h2.message.DbException;
import org.h2.store.fs.FileSystem;
import org.h2.util.Utils; import org.h2.util.Utils;
/** /**
...@@ -66,6 +67,17 @@ public class DbUpgradeNonPageStoreToCurrent { ...@@ -66,6 +67,17 @@ public class DbUpgradeNonPageStoreToCurrent {
boolean isRemote = (Boolean) Utils.callMethod("isRemote", ci); boolean isRemote = (Boolean) Utils.callMethod("isRemote", ci);
boolean isPersistent = (Boolean) Utils.callMethod("isPersistent", ci); boolean isPersistent = (Boolean) Utils.callMethod("isPersistent", ci);
String dbName = (String) Utils.callMethod("getName", ci); String dbName = (String) Utils.callMethod("getName", ci);
// remove stackable file systems
int colon = dbName.indexOf(':');
while (colon != -1) {
String fileSystemPrefix = dbName.substring(colon);
FileSystem fs = FileSystem.getInstance(fileSystemPrefix);
if (fs == null) {
break;
}
dbName = dbName.substring(colon+1);
colon = dbName.indexOf(':');
}
if (!isRemote && isPersistent) { if (!isRemote && isPersistent) {
String oldDataName = dbName + ".data.db"; String oldDataName = dbName + ".data.db";
String oldIndexName = dbName + ".index.db"; String oldIndexName = dbName + ".index.db";
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论