Skip to content

Commit

Permalink
update BackupsCheckThresholds table to hours
Browse files Browse the repository at this point in the history
#305 Added missing update for the BackupsCheckThresholds table
  • Loading branch information
Adedba committed Jan 12, 2023
1 parent 02d756a commit edc9701
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions SQLUndercoverInspector/SQLUndercoverinspectorV2.sql
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,8 @@ GO
Author: Adrian Buckman
Created Date: 15/07/2017
Revision date: 11/01/2023
Version: 2.7
Revision date: 12/01/2023
Version: 2.8
Description: SQLUndercover Inspector setup script Case sensitive compatible.
Creates [Inspector].[InspectorSetup] stored procedure.
Expand Down Expand Up @@ -129,7 +129,7 @@ SET ANSI_NULLS ON;
SET QUOTED_IDENTIFIER ON;
SET CONCAT_NULL_YIELDS_NULL ON;

DECLARE @Revisiondate DATE = '20230111';
DECLARE @Revisiondate DATE = '20230112';
DECLARE @Build VARCHAR(6) ='2.8'

DECLARE @JobID UNIQUEIDENTIFIER;
Expand Down Expand Up @@ -1451,6 +1451,7 @@ EXEC sp_executesql N'CREATE UNIQUE CLUSTERED INDEX [CIX_BackupsCheckThresholds_I
);';
END


IF OBJECT_ID('Inspector.DatabaseFileSizes') IS NULL
BEGIN
--New Column [LastUpdated] for 1.0.1
Expand Down Expand Up @@ -2554,14 +2555,23 @@ END;

IF (EXISTS(SELECT 1 FROM [Inspector].[Settings] WHERE [Description] = 'FullBackupThreshold') AND @CurrentBuild < 2.8)
BEGIN
RAISERROR('Updating your FullBackupThreshold threshold from days to hours if required',0,0) WITH NOWAIT;
RAISERROR('Updating your FullBackupThreshold threshold from days to hours if required in [Inspector].[Settings]',0,0) WITH NOWAIT;

UPDATE [Inspector].[Settings]
SET [Value] = [Value]*24
WHERE [Description] = 'FullBackupThreshold'
AND [Value] IS NOT NULL;

END

/* Convert Full backuo threshold to hours from day */
IF (@CurrentBuild < 2.8)
BEGIN
RAISERROR('Updating your Full backup thresholds from days to hours in [Inspector].[BackupsCheckThresholds]',0,0) WITH NOWAIT;

UPDATE [Inspector].[BackupsCheckThresholds]
SET [FullThreshold] = [FullThreshold]*24;
END
--Populate config
IF @InitialSetup = 1
BEGIN
Expand Down

0 comments on commit edc9701

Please sign in to comment.