Soil
Soil copied to clipboard
Migration: support instance variable rename
When istance variables are renamed during development, but data is already stored in the database, we will currently lose the data of the renamed ivar, as it is seen as a new ivar + remove ivar.
We need to somehow model the "ivar rename" refactoring
This is not that easy:
- Git does not model any data that knows that an ivar was renamed
- There is some support in Epicea
- but epicea data is just stored on the local disk of the developer.
- currently this seems to be disabled (no refactoring is shown in the history when using the RBRenameInstanceVariableRefactoring)
One possibility would be to use a special Slot class that encodes the meta data. ("this slow is named "x" but is used to be "z"). Similar to #102 , one would need to keep this odd slot until one is sure that the database is updated.
We can add a RenamedSlot
-> it should be virtual (subclass of Slot, nit IndexedSlot, thus it takes no offset) -> when writing, it should reflectivey write to the new variable -> it should not be serialized in Soil
The idea is that the code has no reads/writes to that value anymore, thus we do not care about reading.
-> database has a value for the old name => this implies no value for the new
-> we read the old name from the DB and reflectively write it -> value ends up in the new variables
When we now write to the database, it will write the value for the new name and not store the RenamedSlot.
=> Database is from now in a good state.