Skip to content

Commit 7f61030

Browse files
author
Jake Morgan
committed
Add upgrade script
1 parent d06fa60 commit 7f61030

2 files changed

Lines changed: 55 additions & 0 deletions

File tree

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
/*
2+
Copyright 2026 Darling Data, LLC
3+
https://www.erikdarling.com/
4+
5+
Upgrade from 2.4.1 to 2.4.2
6+
Widen config.installation_history.sql_server_version from nvarchar(255) to nvarchar(512).
7+
Idempotent: safe to run multiple times.
8+
*/
9+
10+
SET ANSI_NULLS ON;
11+
SET ANSI_PADDING ON;
12+
SET ANSI_WARNINGS ON;
13+
SET ARITHABORT ON;
14+
SET CONCAT_NULL_YIELDS_NULL ON;
15+
SET QUOTED_IDENTIFIER ON;
16+
SET NUMERIC_ROUNDABORT OFF;
17+
SET IMPLICIT_TRANSACTIONS OFF;
18+
SET STATISTICS TIME, IO OFF;
19+
GO
20+
21+
USE PerformanceMonitor;
22+
GO
23+
24+
IF OBJECT_ID(N'config.installation_history', N'U') IS NOT NULL
25+
BEGIN
26+
IF EXISTS
27+
(
28+
SELECT
29+
1
30+
FROM INFORMATION_SCHEMA.COLUMNS
31+
WHERE TABLE_SCHEMA = N'config'
32+
AND TABLE_NAME = N'installation_history'
33+
AND COLUMN_NAME = N'sql_server_version'
34+
AND DATA_TYPE = N'nvarchar'
35+
AND CHARACTER_MAXIMUM_LENGTH BETWEEN 1 AND 511
36+
)
37+
BEGIN
38+
ALTER TABLE
39+
config.installation_history
40+
ALTER COLUMN
41+
sql_server_version nvarchar(512) NOT NULL;
42+
43+
PRINT 'Widened config.installation_history.sql_server_version to nvarchar(512).';
44+
END
45+
ELSE
46+
BEGIN
47+
PRINT 'config.installation_history.sql_server_version already nvarchar(512) or wider; skipping.';
48+
END;
49+
END
50+
ELSE
51+
BEGIN
52+
PRINT 'Table config.installation_history does not exist; skipping.';
53+
END;
54+
GO
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
01_widen_installation_history_sql_server_version.sql

0 commit comments

Comments
 (0)