Skip to content

Commit 57c1bc8

Browse files
Updates for version 12.4.0.1
1 parent d08e828 commit 57c1bc8

File tree

8 files changed

+1200
-10
lines changed

8 files changed

+1200
-10
lines changed

CSETWebApi/CSETWeb_Api/CSETWebCore.DatabaseManagerTests1/DbManagerTests.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ public void CopyDBAcrossServersTest()
1919
{
2020
string clientCode = "DHS";
2121
string appCode = "CSET";
22-
DbManager manager = new DbManager(new Version("12.4.0.0"), clientCode, appCode);
22+
DbManager manager = new DbManager(new Version("12.4.0.1"), clientCode, appCode);
2323
//TODO finish this.
2424
//manager.CopyDBAcrossServers();
2525
}
@@ -31,7 +31,7 @@ public void CopyDBFromInstallationSource()
3131
//setup a destination file
3232
string clientCode = "DHS";
3333
string appCode = "CSET";
34-
DbManager manager = new DbManager(new Version("12.4.0.0"), clientCode, appCode);
34+
DbManager manager = new DbManager(new Version("12.4.0.1"), clientCode, appCode);
3535
//run the same test twice and make sure that the number increment works
3636
string mdf = $"{Environment.GetFolderPath(Environment.SpecialFolder.UserProfile)}\\CSETWebTest.mdf";
3737
string ldf = $"{Environment.GetFolderPath(Environment.SpecialFolder.UserProfile)}\\CSETWebTest_log.ldf";
@@ -57,7 +57,7 @@ public void TestUpgrade()
5757
//setup a destination file
5858
string clientCode = "Test";
5959
string appCode = "Test";
60-
DbManager manager = new DbManager(new Version("12.4.0.0"), clientCode, appCode);
60+
DbManager manager = new DbManager(new Version("12.4.0.1"), clientCode, appCode);
6161

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

7171
manager.SetupDb();
7272

73-
upgrader.UpgradeOnly(new Version("12.4.0.0"), "data source=(localdb)\\inllocaldb2022;initial catalog=TestWeb;persist security info=True;Integrated Security=SSPI;MultipleActiveResultSets=True");
73+
upgrader.UpgradeOnly(new Version("12.4.0.1"), "data source=(localdb)\\inllocaldb2022;initial catalog=TestWeb;persist security info=True;Integrated Security=SSPI;MultipleActiveResultSets=True");
7474

7575

7676
}
@@ -83,7 +83,7 @@ public void TestSetup()
8383
//setup a destination file
8484
string clientCode = "DHS";
8585
string appCode = "CSET";
86-
DbManager manager = new DbManager(new Version("12.4.0.0"), clientCode, appCode);
86+
DbManager manager = new DbManager(new Version("12.4.0.1"), clientCode, appCode);
8787
manager.SetupDb();
8888
}
8989

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

98-
DbManager manager = new DbManager(new Version("12.4.0.0"), clientCode, appCode);
98+
DbManager manager = new DbManager(new Version("12.4.0.1"), clientCode, appCode);
9999
//run the same test twice and make sure that the number increment works
100100
string conString = "Server=(localdb)\\inllocaldb2022;Integrated Security=true;AttachDbFileName=" + mdf;
101101
using (SqlConnection conn = new SqlConnection(conString))

CSETWebApi/CSETWeb_Api/CSETWebCore.UpgradeLibrary/CSETWebCore.UpgradeLibrary.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
<PropertyGroup>
44
<TargetFramework>net8.0</TargetFramework>
5-
<AssemblyVersion>12.4.0.0</AssemblyVersion>
5+
<AssemblyVersion>12.4.0.1</AssemblyVersion>
66
</PropertyGroup>
77

88
<ItemGroup>
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
////////////////////////////////
2+
//
3+
// Copyright 2024 Battelle Energy Alliance, LLC
4+
//
5+
//
6+
////////////////////////////////
7+
using System;
8+
using Microsoft.Data.SqlClient;
9+
using System.IO;
10+
namespace UpgradeLibrary.Upgrade
11+
{
12+
internal class ConvertDatabase12401 : ConvertSqlDatabase
13+
{
14+
public ConvertDatabase12401(string path) : base(path)
15+
{
16+
myVersion = new Version("12.4.0.1");
17+
}
18+
19+
/// <summary>
20+
/// Runs the database update script
21+
/// </summary>
22+
/// <param name="conn"></param>F
23+
public override void Execute(SqlConnection conn)
24+
{
25+
try
26+
{
27+
RunFile(Path.Combine(this.applicationPath, "VersionUpgrader", "SQL", "12400_to_12401.sql"), conn);
28+
RunFile(Path.Combine(this.applicationPath, "VersionUpgrader", "SQL", "12400_to_12401_data.sql"), conn);
29+
this.UpgradeToVersionLocalDB(conn, myVersion);
30+
}
31+
catch (Exception e)
32+
{
33+
throw new DatabaseUpgradeException("Error in upgrading database version 12.4.0.0 to 12.4.0.1: " + e.Message);
34+
}
35+
}
36+
}
37+
}
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
/*
2+
Run this script on:
3+
4+
(localdb)\INLLocalDB2022.NCUAWeb12400 - This database will be modified
5+
6+
to synchronize it with:
7+
8+
(localdb)\INLLocalDB2022.NCUAWeb12401
9+
10+
You are recommended to back up your database before running this script
11+
12+
Script created by SQL Compare version 14.10.9.22680 from Red Gate Software Ltd at 3/6/2025 3:41:56 PM
13+
14+
*/
15+
SET NUMERIC_ROUNDABORT OFF
16+
GO
17+
SET ANSI_PADDING, ANSI_WARNINGS, CONCAT_NULL_YIELDS_NULL, ARITHABORT, QUOTED_IDENTIFIER, ANSI_NULLS ON
18+
GO
19+
SET XACT_ABORT ON
20+
GO
21+
SET TRANSACTION ISOLATION LEVEL Serializable
22+
GO
23+
BEGIN TRANSACTION
24+
GO
25+
IF @@ERROR <> 0 SET NOEXEC ON
26+
GO
27+
PRINT N'Altering [dbo].[ISE_ACTIONS]'
28+
GO
29+
IF @@ERROR <> 0 SET NOEXEC ON
30+
GO
31+
ALTER TABLE [dbo].[ISE_ACTIONS] ALTER COLUMN [Regulatory_Citation] [nvarchar] (1000) COLLATE SQL_Latin1_General_CP1_CI_AS NULL
32+
GO
33+
IF @@ERROR <> 0 SET NOEXEC ON
34+
GO
35+
COMMIT TRANSACTION
36+
GO
37+
IF @@ERROR <> 0 SET NOEXEC ON
38+
GO
39+
-- This statement writes to the SQL Server Log so SQL Monitor can show this deployment.
40+
IF HAS_PERMS_BY_NAME(N'sys.xp_logevent', N'OBJECT', N'EXECUTE') = 1
41+
BEGIN
42+
DECLARE @databaseName AS nvarchar(2048), @eventMessage AS nvarchar(2048)
43+
SET @databaseName = REPLACE(REPLACE(DB_NAME(), N'\', N'\\'), N'"', N'\"')
44+
SET @eventMessage = N'Redgate SQL Compare: { "deployment": { "description": "Redgate SQL Compare deployed to ' + @databaseName + N'", "database": "' + @databaseName + N'" }}'
45+
EXECUTE sys.xp_logevent 55000, @eventMessage
46+
END
47+
GO
48+
DECLARE @Success AS BIT
49+
SET @Success = 1
50+
SET NOEXEC OFF
51+
IF (@Success = 1) PRINT 'The database update succeeded'
52+
ELSE BEGIN
53+
IF @@TRANCOUNT > 0 ROLLBACK TRANSACTION
54+
PRINT 'The database update failed'
55+
END
56+
GO

0 commit comments

Comments
 (0)