adamfoneil / ModelSync.UI

A diff/merge app for C# model classes to SQL Server. Also merges from database to database
https://aosoftware.net/modelsync/
3 stars 0 forks source link

unexpected FK drops when dropping tables #17

Closed adamfoneil closed 3 years ago

adamfoneil commented 3 years ago

I'm working on a demo video, and skipping around to different steps in a typical dev process. Some of this involves reverting db to prior state, which involves dropping some tables. I'm noticing that there are some unwanted FK drops that are redundant to the table drops. After dropping table InventoryTransaction, attempting to drop its FKs results in error.

image

adamfoneil commented 3 years ago

This is a situation where we're hitting some fundamental limitations of my diff algorithm. The InventoryTransaction drop would work if it were at the end. So there would need to be some dependency ordering of commands in the final script. This order applies really only when dropping

adamfoneil commented 3 years ago

This is what this should look like. Most of the work was here

image