Commit e07d796b authored by 段廷瑞's avatar 段廷瑞

Merge branch 'master' of http://192.168.1.181/root/Ftt_Common

parents 587c8d40 0f7f4caf
......@@ -77,10 +77,10 @@ namespace Ftt.PatchPack
static string MergeSqlRelativePath = "MergeTemp";
/// <summary>
/// 永久有效的年份标记:2999
/// 永久有效的年份标记:2099 / 2999
/// <para>该年份文件夹内的文件、在有效期内的需要打包</para>
/// </summary>
static int ForeverValidYear = 2999;
static List<int> ForeverValidYear = new List<int>() { 2099, 2999 };
#endregion
......@@ -228,7 +228,7 @@ namespace Ftt.PatchPack
foreach (var dire in dires)
{
// 2099-xx-xx文件内的脚本需要取有效期内的。其他日期的文件夹为增量脚本已通过校验,需要取所有。
var hours = ParseToDateTime(dire.Name).Year == ForeverValidYear ? PatchTimeFrame_Sql : -1;
var hours = ForeverValidYear.Contains(ParseToDateTime(dire.Name).Year) ? PatchTimeFrame_Sql : -1;
valid.AddRange(GetValidPatchFile(dire.FullName, "*.sql", SearchOption.AllDirectories, path, "DB", hours)); // 脚本文件夹里的文件永久有效。
}
......@@ -342,11 +342,14 @@ namespace Ftt.PatchPack
FileInfo destMergeFile = null;//合并文件锚点
foreach (var sourceFile in sqlFiles)
{
//2999-xx-xx 的文件夹内,还有子文件夹。层级比其他日期的要多一层,合并时用到的临时目录也需要多一层。
if (sourceFile.RelativePatchPath.StartsWith($"DB\\{ForeverValidYear}"))
foreach (var year in ForeverValidYear)
{
var subPath = Path.Combine(MergeSqlTempFullPath, sourceFile.RelativePatchPath);
if (!Directory.Exists(subPath)) Directory.CreateDirectory(subPath); //创建所有层级的子目录,打包结束会被删除
//2099-xx-xx 的文件夹内,还有子文件夹。层级比其他日期的要多一层,合并时用到的临时目录也需要多一层。
if (sourceFile.RelativePatchPath.StartsWith($"DB\\{year}"))
{
var subPath = Path.Combine(MergeSqlTempFullPath, sourceFile.RelativePatchPath);
if (!Directory.Exists(subPath)) Directory.CreateDirectory(subPath); //创建所有层级的子目录,打包结束会被删除
}
}
var tmpFile = Path.Combine(MergeSqlTempFullPath, $"{sourceFile.RelativePatchPath}_{sourceFile.Name}");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment