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

table rebuild feature to fix column-property order mismatches #8

Open adamfoneil opened 4 years ago

adamfoneil commented 4 years ago

This is to make it easier to keep property and column order in sync. They get out of sync as you add and remove columns during normal development. Keeping them in sync is sort of a "comfort" requirement or even a little bit OCD at times. At any rate, the idea here is to detect tables that have a different column order from the property order, and to offer a painless way to rebuild the table with the updated column order.

I think there should be a node in the object tree view that will show tables with mismatched column-property orders. This node does not contribute to the overall script. You have to click on it directly to get the rebuild script. Each table with mismatched column-property order will get a node.

There are two kinds of rebuilds: those with empty tables vs those with data. Empty table rebuilds are a good bit easier, since no temp table is required.