Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Fix to #27423 - Renaming and dropping columns with Temporal Tables generates faulty migration #27589

Merged
merged 1 commit into from
Mar 9, 2022

Conversation

maumar
Copy link
Contributor

@maumar maumar commented Mar 7, 2022

Problem is that when we drop column from the history table we need to disable versioning (and drop columns in both tables separately). However, since we have disabled the period, renaming (and other operations) also needs to happen for both tables now and we don't do it. So the column is only renamed for the temporal table and the name in history table stays the same. When we try to switch versioning back on the exception is thrown.

Fix is to flow the information to ColumnOperations that the column is part of a temporal table and when we process the migrations, if the versioning for the temporal table has been disabled, mirror the necessary operation(s) to the history table also.

Fixes #27423

@maumar maumar requested a review from AndriySvyryd March 7, 2022 23:47
@maumar
Copy link
Contributor Author

maumar commented Mar 7, 2022

@AndriySvyryd just a port of 6.0 pr

…nerates faulty migration

Problem is that when we drop column from the history table we need to disable versioning (and drop columns in both tables separately). However, since we have disabled the period, renaming (and other operations) also needs to happen for both tables now and we don't do it. So the column is only renamed for the temporal table and the name in history table stays the same. When we try to switch versioning back on the exception is thrown.

Fix is to flow the information to ColumnOperations that the column is part of a temporal table and when we process the migrations, if the versioning for the temporal table has been disabled, mirror the necessary operation(s) to the history table also.

Fixes #27423
@maumar maumar merged commit a5bc598 into main Mar 9, 2022
@maumar maumar deleted the fix27423_main branch March 9, 2022 22:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Renaming and dropping columns with Temporal Tables generates faulty migration
2 participants