modifyColumn vs modifyDataType

There is no good way.

The best that I’ve found is to:

  • add a new column using the element with all the various constraints and whatnot that you want
  • Do UPDATE yourTable SET newColumn = oldColumn
  • Drop the old column with a element
  • Rename newColumn to oldColumn using the refactoring
Extremely ugly and there are all sorts of problems with the update statement given that you might not know what schema yourTable is in.

I’m all ears if someone has a better (portable) idea.

Best,
Laird