|
@@ -790,7 +790,28 @@ namespace WingMongoDBModule.Service
|
|
|
Logger.WriteLineInfo($"mongoDB upgrade failed, now the version is 2.0, error:{ex}");
|
|
|
}
|
|
|
}
|
|
|
+ if (Convert.ToDouble(currentVersion) < 2.1d)//升级DB版本
|
|
|
+ {
|
|
|
+ try
|
|
|
+ { //以下更新数据库版本号时升级具体内容
|
|
|
+ Logger.WriteLineInfo($"mongoDB is upgrading from 2.0 to 2.1, please wait.");
|
|
|
|
|
|
+ await DeleteTwoUserFeatureForResearchProjectDBAsync();
|
|
|
+ //更新版本
|
|
|
+ var isSuccess = await UpgradeToV11.DoUpgradeAsync();
|
|
|
+ if (isSuccess)
|
|
|
+ {
|
|
|
+ //注:下次正式线上发布需要升级DB版本号
|
|
|
+ SetNewDBVersion("2.1").Wait();
|
|
|
+ currentVersion = "2.1";
|
|
|
+ }
|
|
|
+ Logger.WriteLineInfo($"mongoDB upgrade successful, now the version is 2.1");
|
|
|
+ }
|
|
|
+ catch (Exception ex)
|
|
|
+ {
|
|
|
+ Logger.WriteLineInfo($"mongoDB upgrade failed, now the version is 2.1, error:{ex}");
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
/// <summary>
|
|
|
/// 获取当前DB版本
|