Skip to content

Commit

Permalink
Merge pull request #3532 from cisagov/release/12.0.3.2
Browse files Browse the repository at this point in the history
Release/12.0.3.2
  • Loading branch information
randywoods committed Sep 21, 2023
2 parents 48161f5 + 4a1ee69 commit 8bcc2b7
Show file tree
Hide file tree
Showing 11 changed files with 326 additions and 8,398 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public void CopyDBAcrossServersTest()
{
string clientCode = "DHS";
string appCode = "CSET";
DbManager manager = new DbManager(new Version("12.0.3.1"),clientCode, appCode);
DbManager manager = new DbManager(new Version("12.0.3.2"),clientCode, appCode);
//TODO finish this.
//manager.CopyDBAcrossServers();
}
Expand All @@ -42,7 +42,7 @@ public void CopyDBFromInstallationSource()
//setup a destination file
string clientCode = "DHS";
string appCode = "CSET";
DbManager manager = new DbManager(new Version("12.0.3.1"), clientCode, appCode);
DbManager manager = new DbManager(new Version("12.0.3.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 @@ -68,14 +68,14 @@ public void TestUpgrade()
//setup a destination file
string clientCode = "Test";
string appCode = "Test";
DbManager manager = new DbManager(new Version("12.0.3.1"), clientCode, appCode);
DbManager manager = new DbManager(new Version("12.0.3.2"), clientCode, appCode);

//manager.ForceCloseAndDetach(DbManager.localdb2019_ConnectionString, "TestWeb");
//manager.AttachTest("TestWeb", testdb, testlog);
VersionUpgrader upgrader = new VersionUpgrader(Assembly.GetAssembly(typeof(DbManager)).Location);
manager.SetupDb();

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


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

Expand All @@ -100,7 +100,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.0.3.1"), clientCode, appCode);
DbManager manager = new DbManager(new Version("12.0.3.2"), clientCode, appCode);
//run the same test twice and make sure that the number increment works
string conString = "Server=(localdb)\\mssqllocaldb;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>net7.0</TargetFramework>
<AssemblyVersion>12.0.3.1</AssemblyVersion>
<AssemblyVersion>12.0.3.2</AssemblyVersion>
</PropertyGroup>

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

/// <summary>
/// Runs the database update script
/// </summary>
/// <param name="conn"></param>
public override void Execute(SqlConnection conn)
{
try
{
RunFile(Path.Combine(this.applicationPath, "VersionUpgrader", "SQL", "12031_to_12032_data.sql"), conn);

this.UpgradeToVersionLocalDB(conn, myVersion);
}
catch (Exception e)
{
throw new DatabaseUpgradeException("Error in upgrading database version 12.0.3.1 to 12.0.3.2: " + e.Message);
}
}
}
}
Loading

0 comments on commit 8bcc2b7

Please sign in to comment.