Description
In each workspace_build
entry that is added when a user creates a workspace, their chosen preset ID (if any) is set in the template_version_preset_id
column.
For all subsequent transitions of that workspace (stop, start, etc), that template_version_preset_id
column will be null
because we don't set it explicitly.
Now, this is technically _the truth™ _ because the preset wasn't volitionally chosen by the user, and the parameters are still maintained, so it's fine™. BUT, when we want to show the selected preset for a workspace after one of these transitions (say a workspace is stopped and then started again), we will have no record of which preset ID was chosen last.
An idea would be to add a virtual column on the workspaces
table which finds the latest workspace build with a non-null template_version_preset_id
value. This would even work once we allow a user to change their preset after the fact when editing a workspace, since that would be another workspace_builds
entry with a non-null template_version_preset_id
field.
This is not a problem right now because preset selection is kind of fire and forget (i.e. it configures the defined params and a user can never see which preset they chose). Once we need to show which preset was chosen and allow it to be changed, such as pre-selected it in the drop-down list of available presets, then we'd need this information.