Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 0 additions & 41 deletions install/01_install_database.sql
Original file line number Diff line number Diff line change
Expand Up @@ -321,47 +321,6 @@ BEGIN
PRINT 'Created config.collection_schedule table';
END;

/*
Add collect_query and collect_plan columns for existing installations
Controls whether collectors store query text and execution plans
Both default to enabled (1) for backwards compatibility
*/
IF NOT EXISTS
(
SELECT
1/0
FROM sys.columns
WHERE object_id = OBJECT_ID(N'config.collection_schedule')
AND name = N'collect_query'
)
BEGIN
ALTER TABLE
config.collection_schedule
ADD collect_query bit NOT NULL
CONSTRAINT DF_collection_schedule_collect_query
DEFAULT CONVERT(bit, 'true');

PRINT 'Added collect_query column to config.collection_schedule';
END;

IF NOT EXISTS
(
SELECT
1/0
FROM sys.columns
WHERE object_id = OBJECT_ID(N'config.collection_schedule')
AND name = N'collect_plan'
)
BEGIN
ALTER TABLE
config.collection_schedule
ADD collect_plan bit NOT NULL
CONSTRAINT DF_collection_schedule_collect_plan
DEFAULT CONVERT(bit, 'true');

PRINT 'Added collect_plan column to config.collection_schedule';
END;

/*
Critical issues table
Logs significant performance problems detected by collectors and analysis procedures
Expand Down
65 changes: 65 additions & 0 deletions upgrades/2.0.0-to-2.1.0/01_collection_schedule_optional_text.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
/*
Copyright 2026 Darling Data, LLC
https://www.erikdarling.com/

Upgrade from 2.0.0 to 2.1.0
Adds collect_query and collect_plan columns to config.collection_schedule
for optional query text and execution plan collection (#337).
Both default to 1 (enabled) to preserve existing behavior.
*/

SET ANSI_NULLS ON;
SET ANSI_PADDING ON;
SET ANSI_WARNINGS ON;
SET ARITHABORT ON;
SET CONCAT_NULL_YIELDS_NULL ON;
SET QUOTED_IDENTIFIER ON;
SET NUMERIC_ROUNDABORT OFF;
SET IMPLICIT_TRANSACTIONS OFF;
SET STATISTICS TIME, IO OFF;
GO

USE PerformanceMonitor;
GO

/* Add collect_query column for optional query text collection */
IF NOT EXISTS
(
SELECT
1/0
FROM sys.columns
WHERE object_id = OBJECT_ID(N'config.collection_schedule')
AND name = N'collect_query'
)
BEGIN
ALTER TABLE
config.collection_schedule
ADD
collect_query bit NOT NULL
CONSTRAINT DF_collection_schedule_collect_query
DEFAULT CONVERT(bit, 'true');

PRINT 'Added collect_query to config.collection_schedule';
END;
GO

/* Add collect_plan column for optional execution plan collection */
IF NOT EXISTS
(
SELECT
1/0
FROM sys.columns
WHERE object_id = OBJECT_ID(N'config.collection_schedule')
AND name = N'collect_plan'
)
BEGIN
ALTER TABLE
config.collection_schedule
ADD
collect_plan bit NOT NULL
CONSTRAINT DF_collection_schedule_collect_plan
DEFAULT CONVERT(bit, 'true');

PRINT 'Added collect_plan to config.collection_schedule';
END;
GO
1 change: 1 addition & 0 deletions upgrades/2.0.0-to-2.1.0/upgrade.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
01_collection_schedule_optional_text.sql
Loading