Studio : renaming a column not involved in a relation and without changing type should not lose content

Hi

Since recently (and this is good), when renaming a column Studio generates 2 scripts

  • renaming column to column_UNUSED
  • drop column_UNUSED

First, it could be useful to notify user that (s)he has to choose between the two. Especially when the drop script is generated before the rename (screenshot below, and if I understand correctly that the order of presenting is the order of execution).

But more important, if column named changed without changing type (and column is not involved in a relation which can be tricky) a simple alter table rename could be generated.

In our case, we renamed “created objects” to “processed objects”, new name reflects change of semantic but the column is of same type and not involved in a fk.

image

Hi,
Studio generates update scripts comparing the database scheme with the project entity model.
At the moment of scripts generation Studio does not know what was done with the attribute: was it just renamed or removed indeed. So that is why Studio generates drop- and create- scripts.
But you are free to modify the Script source before execution, so you can make DB updater to rename the column instead of dropping.

Regards.

1 Like