|
@@ -59,6 +59,7 @@ namespace WingMongoDBModule.Service
|
|
|
private string _curCDNHost => EnvironmentConfigManager.GetParammeter<StringParameter>("Storage", "CDNServerUrl").Value;
|
|
|
private string _domains => EnvironmentConfigManager.GetParammeter<StringParameter>("Gateway", "Domains").Value;
|
|
|
private string _httpService => EnvironmentConfigManager.GetParammeter<StringParameter>("Services", "JsonRpcHttp").Value;
|
|
|
+ private bool _isResearchEditionService => EnvironmentConfigManager.GetParammeter<BoolParameter>("General", "IsResearchEditionService").Value;
|
|
|
//是否体检系统本地工作站
|
|
|
private bool _isLocalHost => GetStringParams("Vital", "CloudServerUrl") != "";
|
|
|
private int _downloadOriginalLowestValue = 1048576;
|
|
@@ -767,6 +768,29 @@ namespace WingMongoDBModule.Service
|
|
|
Logger.WriteLineInfo($"mongoDB upgrade failed, now the version is 1.9, error:{ex}");
|
|
|
}
|
|
|
}
|
|
|
+ if (Convert.ToDouble(currentVersion) < 2.0d)//升级DB版本
|
|
|
+ {
|
|
|
+ try
|
|
|
+ { //以下更新数据库版本号时升级具体内容
|
|
|
+ Logger.WriteLineInfo($"mongoDB is upgrading from 1.9 to 2.0, please wait.");
|
|
|
+
|
|
|
+ await DeleteUserFeatureForResearchProjectDBAsync();
|
|
|
+ //更新版本
|
|
|
+ var isSuccess = await UpgradeToV11.DoUpgradeAsync();
|
|
|
+ if (isSuccess)
|
|
|
+ {
|
|
|
+ //注:下次正式线上发布需要升级DB版本号
|
|
|
+ SetNewDBVersion("2.0").Wait();
|
|
|
+ currentVersion = "2.0";
|
|
|
+ }
|
|
|
+ Logger.WriteLineInfo($"mongoDB upgrade successful, now the version is 2.0");
|
|
|
+ }
|
|
|
+ catch (Exception ex)
|
|
|
+ {
|
|
|
+ Logger.WriteLineInfo($"mongoDB upgrade failed, now the version is 2.0, error:{ex}");
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
/// <summary>
|
|
|
/// 获取当前DB版本
|