mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
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:
@@ -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.';
|
||||
Reference in New Issue
Block a user