Improved code that re-adds indexes and triggers so it works when renaming a column.