chore: add form_type parameter argument to db (#17920)

`form_type` is a new parameter field in the terraform provider. Bring
that field into coder/coder.

Validation for `multi-select` has also been added.
This commit is contained in:
Steven Masley
2025-05-29 08:55:19 -05:00
committed by GitHub
parent 776c144128
commit 8387dd27ab
35 changed files with 1556 additions and 822 deletions
@@ -0,0 +1,2 @@
ALTER TABLE template_version_parameters DROP COLUMN form_type;
DROP TYPE parameter_form_type;
@@ -0,0 +1,11 @@
CREATE TYPE parameter_form_type AS ENUM ('', 'error', 'radio', 'dropdown', 'input', 'textarea', 'slider', 'checkbox', 'switch', 'tag-select', 'multi-select');
COMMENT ON TYPE parameter_form_type
IS 'Enum set should match the terraform provider set. This is defined as future form_types are not supported, and should be rejected. '
'Always include the empty string for using the default form type.';
-- Intentionally leaving the default blank. The provisioner will not re-run any
-- imports to backfill these values. Missing values just have to be handled.
ALTER TABLE template_version_parameters ADD COLUMN form_type parameter_form_type NOT NULL DEFAULT '';
COMMENT ON COLUMN template_version_parameters.form_type
IS 'Specify what form_type should be used to render the parameter in the UI. Unsupported values are rejected.';