Bug: Migration Script doesn’t set Relationship
versions
#74
Labels
Area: SQL
Relates to the SQL Server database objects; do not use for the repository.
Priority: 1
Severity 2: Major
Status 3: In Progress
Currently being worked on.
Status 5: Complete
Task is considered complete, and ready for deployment.
Type: Bug
Behavior that is inconsistent with documented or expected behavior.
Milestone
With OnTopic 5.0.0, we introduced versioning for
Relationships
. When the migration runs, theVersion
for each relationship is set to theGETUTCDATE()
of the migration. Similar to #70, however, this means that aRollback()
to prior to the OnTopic 5.0.0 migration date will result in relationships being deleted. Unlike #70, however, we don't have historical data as to when each relationship was introduced.Solution
To mitigate this, the migration script should set the
Version
of each relationship to the first version of theSource_TopicID
, thus ensuring that any version that is rolled back to will maintain the pre-migration relationships.Limitations
It's worth noting that this won't make any effort to determine whether the
Target_TopicID
existed at that point. A slightly smarter version might take the earliest version of theSource_TopicID
orTarget_TopicID
, and use the latest of those two versions. In practice, however, this won't be an issue since rolling back a topic only affects the current version, and theTarget_TopicID
will always exist in the database. (If it's deleted, the source relationship will also be deleted with it.) Regardless, this remains consistent with how rollbacks worked prior to OnTopic 5.0.0.The text was updated successfully, but these errors were encountered: