-
Notifications
You must be signed in to change notification settings - Fork 256
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4035 from cisagov/release/12.2.6.0
Release/12.2.6.0
- Loading branch information
Showing
11 changed files
with
22,054 additions
and
58 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
37 changes: 37 additions & 0 deletions
37
CSETWebApi/CSETWeb_Api/CSETWebCore.UpgradeLibrary/VersionUpgrader/ConvertDatabase12260.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | ||
} | ||
} | ||
} | ||
} |
57 changes: 57 additions & 0 deletions
57
CSETWebApi/CSETWeb_Api/CSETWebCore.UpgradeLibrary/VersionUpgrader/SQL/12250_to_12260.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
Oops, something went wrong.