Comment 1 for bug 784341

Revision history for this message
Robert Lyon (robertl-9) wrote :

From what I understand the getAlterFieldSQL() function in postgres7.class.php will create a new temp column in some instances (for instance change of type / precision / decimal).

It will copy the data from the old unaltered field we are changing to the temp one, drop the old field and then rename the temp field to the new altered field.

I suspect that it is this process that is losing the unique keys. So there needs to be a check during the 'Take a look to field metadata' to see if there is any unique key and if so keep a track of it so we can add it back if needed.