Is there a way to set a value for a field for all existing records in the database at addon installation only?
I have an existing Database with the model event.calendar.
In this Database there are already a lot of records for calendar.event
I install a new addon that extends the event.calendar model with a new field "category" with required=TRUE
RESULT / ERROR:
Since the existing records do not hold any value for the new field the installation of the addon fails. Because the NOT NULL constrain could not be created since there are already records with NULL values for the new field. (Chicken Egg problem in some way)
Is there a way to set a default value for this new field but just for all existing records in the Database at module (addon) installation?
I do not want to set a permanent _default parameter for this field since after the installation is done the user should carefully set this field to a meaningful value.