Save only one original definition for TestJob
Closes #644
This reduces the disk space used by TestJob table by approximately
50%. Save what used to be saved in the original_definition
column
in to the definition
column and leave the original_definition
as empty string.
The definition
and original_definition
is almost always the same
but definition
field did not have comments as they don't survive
back and forth loading and dumping. One extremely rare edge case
was if the TestJob was resubmitted through the web UI a "job.original"
key would be saved in the job definition dictionary that would not
be present in original definition. However, this value is never
ever referenced again. In the future it would be better to use
a nullable column to provide integrity and fast lookups.
This is backwards and blue-green migration compatible with dispatchers
because the internal API endpoint used by dispatchers reads the
definition
field.
In the future migration that would remove the original_definition
column it would be good to update the definition
columns with
the values from original_definition
if the original_definition
column was not empty to preserve comments in the definition YAML.