File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 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
Original file line number Diff line number Diff line change 1+ 01_widen_installation_history_sql_server_version.sql
You can’t perform that action at this time.
0 commit comments