Skip to content

Commit 8eb0a04

Browse files
Added ODSE/SRT cdc scripts to Liquibase for Treatment (#246)
1 parent 8574f93 commit 8eb0a04

File tree

5 files changed

+20
-3
lines changed

5 files changed

+20
-3
lines changed
-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
11
-- Upgrade compatibility level to allow inbuilt functions such as StringSplit
22
ALTER DATABASE NBS_ODSE SET COMPATIBILITY_LEVEL = 130;
3-
+1-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
-- Upgrade compatibility level to allow inbuilt functions such as StringSplit
2-
ALTER DATABASE NBS_SRTE SET COMPATIBILITY_LEVEL = 130;
2+
ALTER DATABASE NBS_SRTE SET COMPATIBILITY_LEVEL = 130;
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
databaseChangeLog:
2+
- changeSet:
3+
id: 0
4+
author: liquibase
5+
runOnChange: true
6+
comment: "Enable CDC for Treatment table in ODSE"
7+
changes:
8+
- sqlFile:
9+
path: 000-odse-db-general-001.sql
10+
splitStatements: false
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
11
-- Upgrade compatibility level to allow inbuilt functions such as StringSplit
22
ALTER DATABASE NBS_ODSE SET COMPATIBILITY_LEVEL = 130;
33

4+
-- Check if Treatment table exists and CDC is not enabled, then enable CDC
5+
if not exists(
6+
SELECT 1
7+
FROM sys.tables
8+
WHERE name = 'Treatment' and is_tracked_by_cdc = 1)
9+
begin
10+
exec sys.sp_cdc_enable_table @source_schema = N'dbo',@source_name = N'Treatment',@role_name = NULL;
11+
end;
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
-- Upgrade compatibility level to allow inbuilt functions such as StringSplit
2-
ALTER DATABASE NBS_SRTE SET COMPATIBILITY_LEVEL = 130;
2+
ALTER DATABASE NBS_SRTE SET COMPATIBILITY_LEVEL = 130;

0 commit comments

Comments
 (0)