Rename column - instead of drop and create
If a column is renamed, Schema Compare for Oracle sees this as a drop and create, so during the table rebuild data is preserved asides from the “new” column.
Could you make this work similarly to SQL Compare and execute a rename instead?
I’ve done the work for column rename detection. This will be a default option in the next release of Schema Compare and Source Control for Oracle.
It probably won’t be perfect but the option can be turned off if it causes problems.
-
AdminRichard Mitchell (Admin, Redgate) commented
Just tried to recreate that and I'm seeing a different result in my test case. I know it copes badly with very short column names (the longest substring routine is limited).
If you could email the script of the two tables that would be great email:richard.mitchell@red-gate.com
-
AdminRichard Mitchell (Admin, Redgate) commented
Great, I think it doesn't take into account the primary key status and probably not any other constraint in order to add information into the matching. I'll look into improving it now. I will also look into the UI feature but I can't promise anything on that front as there are so many other things I need to finish off currently.
-
Allen S commented
We had a situation where two columns had been renamed in the same table: u_id -> user_id, and c_id -> id.
It saw one, but not the other as a rename. The c_id column was the primary key, and was the one not detected as a rename.
-
AdminRichard Mitchell (Admin, Redgate) commented
There is an option to turn it off for false positives however for false negatives I'd much prefer test cases so I can improve the automatic ability of rename detection.
Adding manual column mapping could be done similar to SQL Compare but there's a lot of UI work needed that I don't yet have the time for.
-
Allen S commented
Now we need a manual column mapping to fix misdetections and add missed detections!