- Notifications
You must be signed in to change notification settings - Fork1k
feat: add "display_order" column to coder_parameter to keep parameters sorted in UI#8227
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
This turned out nicely, nice to see a bunch of code removed! 😍
@@ -0,0 +1,4 @@ | |||
ALTERTABLE template_version_parameters ADD COLUMN display_orderintegerNOT NULL DEFAULT0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
It's possible to use a reserved word as a name via quoting, e.g.ADD COLUMN "order"
, but I prefer this approach 👍🏻.
Uh oh!
There was an error while loading.Please reload this page.
-- name: GetTemplateVersionParameters :many | ||
SELECT*FROM template_version_parametersWHERE template_version_id= $1; | ||
SELECT*FROM template_version_parametersWHERE template_version_id= $1ORDER BY display_orderASC,LOWER(name)ASC; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Thanks for using explicitASC
, helps to convey the intent.
Uh oh!
There was an error while loading.Please reload this page.
Fixes:#8193
This PR implements the "display_order" db column (
ORDER
is a reserved word), which is used to ensure the order of parameters based on thecoder_parameter
TFproperty.