From non historized to historized attributes - No SQL change

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

From non historized to historized attributes - No SQL change

Emmanuel
Hi.

I've the case where I need to change a model from non-historized attributes to historized attributes.
As when I have to add an attribute or a Tie, I was expecting the model to just add new objects (tables...).
But when I switch on the historization of an already existing attribute, nothing is changed in the database.
When I read the SQL code generated, it tests "IF EXISTS..." with the name of the attribute.
Because its name does not change when I toggle historization, nothing happens.

The only solution then is to drop the table and recreate it which can be painful when several attributes have to be changed.

Is it something done on purpose or a bug in the SQL code generation?
Is there a better way to deal with this kind of model evolution ?

Best regards
Emmanuel
Reply | Threaded
Open this post in threaded view
|

Re: From non historized to historized attributes - No SQL change

roenbaeck
Administrator
This was done on purpose, since it is a change that needs supervision. For example, you would need to provide proper timestamps for the changing time when the non-historized values become historized. We therefore recommend "manual" migration of existing data.