Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release/12.0.3.2 #3532

Merged
merged 8 commits into from
Sep 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading