Skip to content

Commit dc1b927

Browse files
committed
Merge branch 'bugfix/SQL-updates' into develop
Fixed a couple of bugs in the SQL scripts discovered as part of final integration testing. - Updated migration script to ensure that the `BaseTopic` attribute was correctly renamed. Previously, there were two errors in the migration script which prevented this from being correctly updated (0929fb4). - Updated the `CreateTopic` stored procedure so that it will correctly create a root topic if none already exists (ade1f90). This resolves a bug introduced previously when allowing _additional_ root topics to be added (5000ca0); in doing so, I inadvertently prevented the _initial_ root topic from being created.
2 parents fd92c56 + ade1f90 commit dc1b927

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

OnTopic.Data.Sql.Database/Scripts/Upgrade from OnTopic 4 to OnTopic 5.sql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,8 +133,8 @@ WHERE ReferenceKey = 'Topic'
133133

134134
UPDATE Topics
135135
SET TopicKey = 'BaseTopic'
136-
WHERE TopicKey = 'DerivedTopic'
137-
AND ContentType = 'TopicReferenceAttributeDescriptor'
136+
WHERE TopicKey = 'InheritedTopic'
137+
AND ContentType = 'TopicReferenceAttribute'
138138

139139
--------------------------------------------------------------------------------------------------------------------------------
140140
-- MIGRATE ATTRIBUTE KEYS

OnTopic.Data.Sql.Database/Stored Procedures/CreateTopic.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ IF (@ParentID IS NOT NULL)
9090
END
9191
ELSE
9292
BEGIN
93-
SELECT @RangeRight = MAX(RangeRight) + 1
93+
SELECT @RangeRight = ISNULL(MAX(RangeRight), 0) + 1
9494
FROM Topics
9595
WITH ( TABLOCK
9696
)

0 commit comments

Comments
 (0)