Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Bug: Migration Script doesn’t set TopicReference versions #70

Closed
JeremyCaney opened this issue Mar 28, 2021 · 2 comments
Closed

Bug: Migration Script doesn’t set TopicReference versions #70

JeremyCaney opened this issue Mar 28, 2021 · 2 comments
Assignees
Labels
Area: SQL Relates to the SQL Server database objects; do not use for the repository. Priority: 1 Severity 2: Major Status 5: Complete Task is considered complete, and ready for deployment. Type: Bug Behavior that is inconsistent with documented or expected behavior.
Milestone

Comments

@JeremyCaney
Copy link
Member

JeremyCaney commented Mar 28, 2021

The migration script should set the Version of the migrated topic references to that of the source AttributeValue. This was inadvertently overlooked during development since, originally, topic references couldn’t be versioned. As a result, rolling back to a version from before the 5.0.0 version results in topic references getting deleted.

Should ideally apply a retroactive patch for migrated topics by joining them against Attributes with a match between AttributeValue and target_TopicID.

Similarly, the default version for existing relationships should be set to the first version of the topic, since relationships can now be versioned as well. This likely defaulted to the date of the migration.

@JeremyCaney JeremyCaney added Type: Bug Behavior that is inconsistent with documented or expected behavior. Area: Repositories Relates to the `ITopicRepository` interface or one of its implementations. Severity 2: Major Priority: 1 Status 2: Scheduled Planned for an upcoming release. labels Mar 28, 2021
@JeremyCaney JeremyCaney added this to the OnTopic 5.1.0 milestone Mar 28, 2021
@JeremyCaney JeremyCaney self-assigned this Mar 28, 2021
@JeremyCaney JeremyCaney changed the title Bug: Migration Script doesn’t set TopicReference Version Bug: Migration Script doesn’t set TopicReference Version Mar 29, 2021
@JeremyCaney
Copy link
Member Author

This should include all historical versions as well. Otherwise, rollbacks prior to the last update will introduce the same problem.

@JeremyCaney JeremyCaney changed the title Bug: Migration Script doesn’t set TopicReference Version Bug: Migration Script doesn’t set association versions Mar 30, 2021
@JeremyCaney JeremyCaney changed the title Bug: Migration Script doesn’t set association versions Bug: Migration Script doesn’t set TopicReference versions Mar 30, 2021
JeremyCaney added a commit that referenced this issue Mar 30, 2021
The migration script for `TopicReferences` was written prior to versions being introduced, and thus doesn't include the version field. This introduces a problem if a topic is rolled back to a version prior to the OnTopic 5.0.0 upgrade, as that's when the `Version` for each of the `TopicReferences` will be set; in that case, the topic reference(s) will be deleted.

To mitigate that, the migration script needs to be updated to include each historical topic attribute version from `Attributes`, not just the latest version from the `AttributeIndex`, and to include the `Version` for each. This is an easy migration.

Customers that have already migrated to OnTopic 5.0.0 will need to manually migrate these and then remove duplicates. Fortunately, this only applies to a couple of migrations, and should be easy. (Other current implementations are new, and don't have this issue.)

This addresses #70.
JeremyCaney added a commit that referenced this issue Mar 30, 2021
There were a number of bugs in how association versioning—i.e., versioning of `TopicReferences` and `Relationships`—was addressed as part of the migration and utility scripts, which this update resolves.

This includes:
- Setting the `Version` as part of the `TopicReferences` migration (#70, d041eae)
- Setting the `Version` as part of the `Relationships` migration (#74, 2ec30da)
- Consolidating the `TopicReferences` as part of `ConsolidateVersions` (#75, 7e322c0)
- Consolidating the `Relationships` as part of `ConsolidateVersions` (#75, b8c5d09)
@JeremyCaney JeremyCaney added Status 5: Complete Task is considered complete, and ready for deployment. and removed Status 2: Scheduled Planned for an upcoming release. labels Mar 30, 2021
@JeremyCaney
Copy link
Member Author

The Version on TopicReferences is now set as part of the migration script, as per d041eae.

@JeremyCaney JeremyCaney added Area: SQL Relates to the SQL Server database objects; do not use for the repository. and removed Area: Repositories Relates to the `ITopicRepository` interface or one of its implementations. labels Apr 3, 2021
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
Area: SQL Relates to the SQL Server database objects; do not use for the repository. Priority: 1 Severity 2: Major Status 5: Complete Task is considered complete, and ready for deployment. Type: Bug Behavior that is inconsistent with documented or expected behavior.
Projects
None yet
Development

No branches or pull requests

1 participant