Skip to content

Commit dc8d988

Browse files
committed
Account for variability in DerivedTopic attribute descriptor name
The (legacy) `DerivedTopic` attribute descriptor varied in name. In most databases, it is `InheritedTopic`, but in some newer databases it is `TopicId` or `DerivedTopic`. The variability of the attribute key is permitted by a legacy artifact of the fact that, originally, the `TopicReferenceAttribute` had a hard-coded value of `TopicId` and, therefore, it didn't matter what the key was. As this was later extended to support general topic references, and not _just_ base topic references, this was modified, and thus implementations of e.g. OnTopic 4.6 use the `TopicId` key. It's worth noting that one of the objectives of the `BaseTopic` handling in OnTopic 5.0.0 is to apply uniform nomenclature around this concept, with unified attribute descriptor, attribute keys, etc. This helps deliver on that objective.
1 parent c68040a commit dc8d988

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ WHERE ReferenceKey = 'Topic'
133133

134134
UPDATE Topics
135135
SET TopicKey = 'BaseTopic'
136-
WHERE TopicKey = 'InheritedTopic'
136+
WHERE TopicKey IN ('TopicID', 'InheritedTopic', 'DerivedTopic')
137137
AND ContentType = 'TopicReferenceAttribute'
138138

139139
--------------------------------------------------------------------------------------------------------------------------------

0 commit comments

Comments
 (0)