Skip to content

Commit

Permalink
Merge pull request #4321 from cisagov/release/12.3.0.2
Browse files Browse the repository at this point in the history
Release/12.3.0.2
  • Loading branch information
randywoods authored Jan 6, 2025
2 parents 73aa2c2 + 23908f8 commit 70bb869
Show file tree
Hide file tree
Showing 28 changed files with 15,070 additions and 1,213 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -74,3 +74,4 @@ CSETWebApi/NCUA-EXAMINER-TOOL
/CSETWebApi/CSETWeb_Api/CSETWebCore.DatabaseManagerTests1/Data/CSETWeb.mdf
/CSETWebApi/CSETWeb_Api/CSETWebCore.DatabaseManagerTests1/Data/CSETWeb_log.ldf
/CSETWebApi/CSETWeb_Api/CSETWeb_ApiCore/Diagram-orig
/gallery-editor
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public void CopyDBAcrossServersTest()
{
string clientCode = "DHS";
string appCode = "CSET";
DbManager manager = new DbManager(new Version("12.3.0.0"), clientCode, appCode);
DbManager manager = new DbManager(new Version("12.3.0.2"), clientCode, appCode);
//TODO finish this.
//manager.CopyDBAcrossServers();
}
Expand All @@ -31,7 +31,7 @@ public void CopyDBFromInstallationSource()
//setup a destination file
string clientCode = "DHS";
string appCode = "CSET";
DbManager manager = new DbManager(new Version("12.3.0.0"), clientCode, appCode);
DbManager manager = new DbManager(new Version("12.3.0.2"), clientCode, appCode);
//run the same test twice and make sure that the number increment works
string mdf = $"{Environment.GetFolderPath(Environment.SpecialFolder.UserProfile)}\\CSETWebTest.mdf";
string ldf = $"{Environment.GetFolderPath(Environment.SpecialFolder.UserProfile)}\\CSETWebTest_log.ldf";
Expand All @@ -57,7 +57,7 @@ public void TestUpgrade()
//setup a destination file
string clientCode = "Test";
string appCode = "Test";
DbManager manager = new DbManager(new Version("12.3.0.0"), clientCode, appCode);
DbManager manager = new DbManager(new Version("12.3.0.2"), clientCode, appCode);

//manager.ForceCloseAndDetach(DbManager.localdb2019_ConnectionString, "TestWeb");
//manager.AttachTest("TestWeb", testdb, testlog);
Expand All @@ -70,7 +70,7 @@ public void TestUpgrade()

manager.SetupDb();

upgrader.UpgradeOnly(new Version("12.3.0.0"), "data source=(localdb)\\inllocaldb2022;initial catalog=TestWeb;persist security info=True;Integrated Security=SSPI;MultipleActiveResultSets=True");
upgrader.UpgradeOnly(new Version("12.3.0.2"), "data source=(localdb)\\inllocaldb2022;initial catalog=TestWeb;persist security info=True;Integrated Security=SSPI;MultipleActiveResultSets=True");


}
Expand All @@ -83,7 +83,7 @@ public void TestSetup()
//setup a destination file
string clientCode = "DHS";
string appCode = "CSET";
DbManager manager = new DbManager(new Version("12.3.0.0"), clientCode, appCode);
DbManager manager = new DbManager(new Version("12.3.0.2"), clientCode, appCode);
manager.SetupDb();
}

Expand All @@ -95,7 +95,7 @@ public void CopyDBFromInstallationSourceTest2()
string mdf = $"{Environment.GetFolderPath(Environment.SpecialFolder.UserProfile)}\\CSETWebTest.mdf";
string ldf = $"{Environment.GetFolderPath(Environment.SpecialFolder.UserProfile)}\\CSETWebTest_log.ldf";

DbManager manager = new DbManager(new Version("12.3.0.0"), clientCode, appCode);
DbManager manager = new DbManager(new Version("12.3.0.2"), clientCode, appCode);
//run the same test twice and make sure that the number increment works
string conString = "Server=(localdb)\\inllocaldb2022;Integrated Security=true;AttachDbFileName=" + mdf;
using (SqlConnection conn = new SqlConnection(conString))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<AssemblyVersion>12.3.0.1</AssemblyVersion>
<AssemblyVersion>12.3.0.2</AssemblyVersion>
</PropertyGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
////////////////////////////////
//
// Copyright 2024 Battelle Energy Alliance, LLC
//
//
////////////////////////////////
using System;
using Microsoft.Data.SqlClient;
using System.IO;
namespace UpgradeLibrary.Upgrade
{
internal class ConvertDatabase12302 : ConvertSqlDatabase
{
public ConvertDatabase12302(string path) : base(path)
{
myVersion = new Version("12.3.0.2");
}

/// <summary>
/// Runs the database update script
/// </summary>
/// <param name="conn"></param>F
public override void Execute(SqlConnection conn)
{
try
{
RunFile(Path.Combine(this.applicationPath, "VersionUpgrader", "SQL", "12301_to_12302.sql"), conn);
RunFile(Path.Combine(this.applicationPath, "VersionUpgrader", "SQL", "12301_to_12302_data.sql"), conn);
this.UpgradeToVersionLocalDB(conn, myVersion);
}
catch (Exception e)
{
throw new DatabaseUpgradeException("Error in upgrading database version 12.3.0.1 to 12.3.0.2: " + e.Message);
}
}
}
}
Loading

0 comments on commit 70bb869

Please sign in to comment.