aspnet/EntityFramework — pull request #501 by emilcicos (2014-08-07 01:41:24+00:00)
Title: Updated the table diffing algorithm.

1. Entity types are matched by name first. Out of the remaining ones they are fuzzy matched (at least 80% of the properties must match across both entities).
2. Using the entity type pairs it finds the table pairs (currently 1 to 1)
3. Foreach table pair it builds a list of column pairs. The column are matched by the corresponding property names. Out of the remaining columns they are matched by their names. Simultaneously it builds a global map of columns, used later when matching column references from primary keys, foreign keys, indexes.
4. Using the table pairs it finds the moved, renamed, created, dropped, tables.
5. Foreach table pair:
- Using the table column pairs it finds the renamed, added, dropped, altered columns.
- It finds the primary key changes (drop, add or both).
- It finds the foreign key pairs.
- Using the foreign key pairs it finds the added, dropped foreign keys.
- It finds the index pairs.
- Using the index pairs it finds the renamed, added, dropped indexes.