Skip to content

Commit

Permalink
Merge pull request #4035 from cisagov/release/12.2.6.0
Browse files Browse the repository at this point in the history
Release/12.2.6.0
  • Loading branch information
Marcus-Goectau authored Aug 30, 2024
2 parents caceae5 + 579724e commit ed3c5f6
Show file tree
Hide file tree
Showing 11 changed files with 22,054 additions and 58 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.2.5.0"), clientCode, appCode);
DbManager manager = new DbManager(new Version("12.2.6.0"), 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.2.5.0"), clientCode, appCode);
DbManager manager = new DbManager(new Version("12.2.6.0"), 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,7 +68,7 @@ public void TestUpgrade()
//setup a destination file
string clientCode = "Test";
string appCode = "Test";
DbManager manager = new DbManager(new Version("12.2.5.0"), clientCode, appCode);
DbManager manager = new DbManager(new Version("12.2.6.0"), clientCode, appCode);

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

manager.SetupDb();

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


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

Expand All @@ -106,7 +106,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.2.5.0"), clientCode, appCode);
DbManager manager = new DbManager(new Version("12.2.6.0"), 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.2.5.0</AssemblyVersion>
<AssemblyVersion>12.2.6.0</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 ConvertDatabase12260 : ConvertSqlDatabase
{
public ConvertDatabase12260(string path) : base(path)
{
myVersion = new Version("12.2.6.0");
}

/// <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", "12250_to_12260.sql"), conn);
RunFile(Path.Combine(this.applicationPath, "VersionUpgrader", "SQL", "12250_to_12260_data.sql"), conn);
this.UpgradeToVersionLocalDB(conn, myVersion);
}
catch (Exception e)
{
throw new DatabaseUpgradeException("Error in upgrading database version 12.2.5.0 to 12.2.6.0: " + e.Message);
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
/*
Run this script on:
(localdb)\INLLocalDB2022.CSETWeb12250 - This database will be modified
to synchronize it with:
(localdb)\INLLocalDB2022.CSETWeb12260
You are recommended to back up your database before running this script
Script created by SQL Compare version 14.10.9.22680 from Red Gate Software Ltd at 8/26/2024 11:49:28 AM
*/
SET NUMERIC_ROUNDABORT OFF
GO
SET ANSI_PADDING, ANSI_WARNINGS, CONCAT_NULL_YIELDS_NULL, ARITHABORT, QUOTED_IDENTIFIER, ANSI_NULLS ON
GO
SET XACT_ABORT ON
GO
SET TRANSACTION ISOLATION LEVEL Serializable
GO
BEGIN TRANSACTION
GO
IF @@ERROR <> 0 SET NOEXEC ON
GO
PRINT N'Altering [dbo].[MATURITY_QUESTIONS]'
GO
IF @@ERROR <> 0 SET NOEXEC ON
GO
ALTER TABLE [dbo].[MATURITY_QUESTIONS] ADD
[Implementation_Guides] [nvarchar] (max) COLLATE SQL_Latin1_General_CP1_CI_AS NULL
GO
IF @@ERROR <> 0 SET NOEXEC ON
GO
COMMIT TRANSACTION
GO
IF @@ERROR <> 0 SET NOEXEC ON
GO
-- This statement writes to the SQL Server Log so SQL Monitor can show this deployment.
IF HAS_PERMS_BY_NAME(N'sys.xp_logevent', N'OBJECT', N'EXECUTE') = 1
BEGIN
DECLARE @databaseName AS nvarchar(2048), @eventMessage AS nvarchar(2048)
SET @databaseName = REPLACE(REPLACE(DB_NAME(), N'\', N'\\'), N'"', N'\"')
SET @eventMessage = N'Redgate SQL Compare: { "deployment": { "description": "Redgate SQL Compare deployed to ' + @databaseName + N'", "database": "' + @databaseName + N'" }}'
EXECUTE sys.xp_logevent 55000, @eventMessage
END
GO
DECLARE @Success AS BIT
SET @Success = 1
SET NOEXEC OFF
IF (@Success = 1) PRINT 'The database update succeeded'
ELSE BEGIN
IF @@TRANCOUNT > 0 ROLLBACK TRANSACTION
PRINT 'The database update failed'
END
GO
Loading

0 comments on commit ed3c5f6

Please sign in to comment.