mirror of
https://github.com/coder/coder.git
synced 2025-07-13 21:36:50 +00:00
feat!: drop LegacyVariableName from coder parameter (#8360)
This commit is contained in:
3
coderd/apidoc/docs.go
generated
3
coderd/apidoc/docs.go
generated
@ -9178,9 +9178,6 @@ const docTemplate = `{
|
||||
"icon": {
|
||||
"type": "string"
|
||||
},
|
||||
"legacy_variable_name": {
|
||||
"type": "string"
|
||||
},
|
||||
"mutable": {
|
||||
"type": "boolean"
|
||||
},
|
||||
|
3
coderd/apidoc/swagger.json
generated
3
coderd/apidoc/swagger.json
generated
@ -8287,9 +8287,6 @@
|
||||
"icon": {
|
||||
"type": "string"
|
||||
},
|
||||
"legacy_variable_name": {
|
||||
"type": "string"
|
||||
},
|
||||
"mutable": {
|
||||
"type": "boolean"
|
||||
},
|
||||
|
@ -75,7 +75,6 @@ func TemplateVersionParameter(param database.TemplateVersionParameter) (codersdk
|
||||
ValidationError: param.ValidationError,
|
||||
ValidationMonotonic: codersdk.ValidationMonotonicOrder(param.ValidationMonotonic),
|
||||
Required: param.Required,
|
||||
LegacyVariableName: param.LegacyVariableName,
|
||||
}, nil
|
||||
}
|
||||
|
||||
|
@ -3966,7 +3966,6 @@ func (q *fakeQuerier) InsertTemplateVersionParameter(_ context.Context, arg data
|
||||
ValidationMonotonic: arg.ValidationMonotonic,
|
||||
Required: arg.Required,
|
||||
DisplayOrder: arg.DisplayOrder,
|
||||
LegacyVariableName: arg.LegacyVariableName,
|
||||
}
|
||||
q.templateVersionParameters = append(q.templateVersionParameters, param)
|
||||
return param, nil
|
||||
|
3
coderd/database/dump.sql
generated
3
coderd/database/dump.sql
generated
@ -463,7 +463,6 @@ CREATE TABLE template_version_parameters (
|
||||
validation_error text DEFAULT ''::text NOT NULL,
|
||||
validation_monotonic text DEFAULT ''::text NOT NULL,
|
||||
required boolean DEFAULT true NOT NULL,
|
||||
legacy_variable_name text DEFAULT ''::text NOT NULL,
|
||||
display_name text DEFAULT ''::text NOT NULL,
|
||||
display_order integer DEFAULT 0 NOT NULL,
|
||||
CONSTRAINT validation_monotonic_order CHECK ((validation_monotonic = ANY (ARRAY['increasing'::text, 'decreasing'::text, ''::text])))
|
||||
@ -495,8 +494,6 @@ COMMENT ON COLUMN template_version_parameters.validation_monotonic IS 'Validatio
|
||||
|
||||
COMMENT ON COLUMN template_version_parameters.required IS 'Is parameter required?';
|
||||
|
||||
COMMENT ON COLUMN template_version_parameters.legacy_variable_name IS 'Name of the legacy variable for migration purposes';
|
||||
|
||||
COMMENT ON COLUMN template_version_parameters.display_name IS 'Display name of the rich parameter';
|
||||
|
||||
COMMENT ON COLUMN template_version_parameters.display_order IS 'Specifies the order in which to display parameters in user interfaces.';
|
||||
|
@ -0,0 +1,5 @@
|
||||
-- Unfortunately we can't bring back deleted values.
|
||||
|
||||
ALTER TABLE template_version_parameters ADD COLUMN legacy_variable_name text NOT NULL DEFAULT '';
|
||||
|
||||
COMMENT ON COLUMN template_version_parameters.legacy_variable_name IS 'Name of the legacy variable for migration purposes';
|
@ -0,0 +1 @@
|
||||
ALTER TABLE template_version_parameters DROP COLUMN legacy_variable_name;
|
@ -1639,8 +1639,6 @@ type TemplateVersionParameter struct {
|
||||
ValidationMonotonic string `db:"validation_monotonic" json:"validation_monotonic"`
|
||||
// Is parameter required?
|
||||
Required bool `db:"required" json:"required"`
|
||||
// Name of the legacy variable for migration purposes
|
||||
LegacyVariableName string `db:"legacy_variable_name" json:"legacy_variable_name"`
|
||||
// Display name of the rich parameter
|
||||
DisplayName string `db:"display_name" json:"display_name"`
|
||||
// Specifies the order in which to display parameters in user interfaces.
|
||||
|
@ -4174,7 +4174,7 @@ func (q *sqlQuerier) UpdateTemplateScheduleByID(ctx context.Context, arg UpdateT
|
||||
}
|
||||
|
||||
const getTemplateVersionParameters = `-- name: GetTemplateVersionParameters :many
|
||||
SELECT template_version_id, name, description, type, mutable, default_value, icon, options, validation_regex, validation_min, validation_max, validation_error, validation_monotonic, required, legacy_variable_name, display_name, display_order FROM template_version_parameters WHERE template_version_id = $1 ORDER BY display_order ASC, LOWER(name) ASC
|
||||
SELECT template_version_id, name, description, type, mutable, default_value, icon, options, validation_regex, validation_min, validation_max, validation_error, validation_monotonic, required, display_name, display_order FROM template_version_parameters WHERE template_version_id = $1 ORDER BY display_order ASC, LOWER(name) ASC
|
||||
`
|
||||
|
||||
func (q *sqlQuerier) GetTemplateVersionParameters(ctx context.Context, templateVersionID uuid.UUID) ([]TemplateVersionParameter, error) {
|
||||
@ -4201,7 +4201,6 @@ func (q *sqlQuerier) GetTemplateVersionParameters(ctx context.Context, templateV
|
||||
&i.ValidationError,
|
||||
&i.ValidationMonotonic,
|
||||
&i.Required,
|
||||
&i.LegacyVariableName,
|
||||
&i.DisplayName,
|
||||
&i.DisplayOrder,
|
||||
); err != nil {
|
||||
@ -4235,7 +4234,6 @@ INSERT INTO
|
||||
validation_error,
|
||||
validation_monotonic,
|
||||
required,
|
||||
legacy_variable_name,
|
||||
display_name,
|
||||
display_order
|
||||
)
|
||||
@ -4256,9 +4254,8 @@ VALUES
|
||||
$13,
|
||||
$14,
|
||||
$15,
|
||||
$16,
|
||||
$17
|
||||
) RETURNING template_version_id, name, description, type, mutable, default_value, icon, options, validation_regex, validation_min, validation_max, validation_error, validation_monotonic, required, legacy_variable_name, display_name, display_order
|
||||
$16
|
||||
) RETURNING template_version_id, name, description, type, mutable, default_value, icon, options, validation_regex, validation_min, validation_max, validation_error, validation_monotonic, required, display_name, display_order
|
||||
`
|
||||
|
||||
type InsertTemplateVersionParameterParams struct {
|
||||
@ -4276,7 +4273,6 @@ type InsertTemplateVersionParameterParams struct {
|
||||
ValidationError string `db:"validation_error" json:"validation_error"`
|
||||
ValidationMonotonic string `db:"validation_monotonic" json:"validation_monotonic"`
|
||||
Required bool `db:"required" json:"required"`
|
||||
LegacyVariableName string `db:"legacy_variable_name" json:"legacy_variable_name"`
|
||||
DisplayName string `db:"display_name" json:"display_name"`
|
||||
DisplayOrder int32 `db:"display_order" json:"display_order"`
|
||||
}
|
||||
@ -4297,7 +4293,6 @@ func (q *sqlQuerier) InsertTemplateVersionParameter(ctx context.Context, arg Ins
|
||||
arg.ValidationError,
|
||||
arg.ValidationMonotonic,
|
||||
arg.Required,
|
||||
arg.LegacyVariableName,
|
||||
arg.DisplayName,
|
||||
arg.DisplayOrder,
|
||||
)
|
||||
@ -4317,7 +4312,6 @@ func (q *sqlQuerier) InsertTemplateVersionParameter(ctx context.Context, arg Ins
|
||||
&i.ValidationError,
|
||||
&i.ValidationMonotonic,
|
||||
&i.Required,
|
||||
&i.LegacyVariableName,
|
||||
&i.DisplayName,
|
||||
&i.DisplayOrder,
|
||||
)
|
||||
|
@ -15,7 +15,6 @@ INSERT INTO
|
||||
validation_error,
|
||||
validation_monotonic,
|
||||
required,
|
||||
legacy_variable_name,
|
||||
display_name,
|
||||
display_order
|
||||
)
|
||||
@ -36,8 +35,7 @@ VALUES
|
||||
$13,
|
||||
$14,
|
||||
$15,
|
||||
$16,
|
||||
$17
|
||||
$16
|
||||
) RETURNING *;
|
||||
|
||||
-- name: GetTemplateVersionParameters :many
|
||||
|
@ -826,7 +826,6 @@ func (server *Server) CompleteJob(ctx context.Context, completed *proto.Complete
|
||||
ValidationMonotonic: richParameter.ValidationMonotonic,
|
||||
Required: richParameter.Required,
|
||||
DisplayOrder: richParameter.Order,
|
||||
LegacyVariableName: richParameter.LegacyVariableName,
|
||||
})
|
||||
if err != nil {
|
||||
return nil, xerrors.Errorf("insert parameter: %w", err)
|
||||
|
@ -1484,7 +1484,6 @@ func convertTemplateVersionParameter(param database.TemplateVersionParameter) (c
|
||||
ValidationError: param.ValidationError,
|
||||
ValidationMonotonic: codersdk.ValidationMonotonicOrder(param.ValidationMonotonic),
|
||||
Required: param.Required,
|
||||
LegacyVariableName: param.LegacyVariableName,
|
||||
}, nil
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user