Migrations: Additional fix for #1244 - Migrations: Migrating from PK/FK to separated out FK as an IA scaffold invalid migration
Problem: The initial fix for 1244 was to not detect IA FK renames if the original column is still present in the target model. However, we should still detect renames when the original column is in the target model as part of some new FK.
Solution: Detect this case in FindRenamedForeignKeyColumns
Other changes:
1) Related to the specific case identified in #368, when two columns are having their names swapped, we would generate two rename column operations, which would fail because the target name of the first rename operation already exists in the database. This is a general transitive-dependency problem with renaming - I created a simple solver that breaks dependencies between renames by introducing intermediate rename operations to system-generated temporary names.
2) Fixed an issue in BuildColumnNormalizedSourceModel, where some columns could be incorrectly normalized twice.
Work Item: 1244
↧