- Notifications
You must be signed in to change notification settings - Fork920
chore: make has_ai_task fields on workspace builds and template versions nullable#18403
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.
Changes fromall commits
File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading.Please reload this page.
Jump to
Uh oh!
There was an error while loading.Please reload this page.
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more abouthow customized files appear on GitHub.
Uh oh!
There was an error while loading.Please reload this page.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
ALTER TABLE template_versions ALTER COLUMN has_ai_task SET DEFAULT false; | ||
ALTER TABLE template_versions ALTER COLUMN has_ai_task SET NOT NULL; | ||
ALTER TABLE workspace_builds ALTER COLUMN has_ai_task SET DEFAULT false; | ||
ALTER TABLE workspace_builds ALTER COLUMN has_ai_task SET NOT NULL; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
-- The fields must be nullable because there's a period of time between | ||
-- inserting a row into the database and finishing the "plan" provisioner job | ||
-- when the final value of the field is unknown. | ||
ALTER TABLE template_versions ALTER COLUMN has_ai_task DROP DEFAULT; | ||
ALTER TABLE template_versions ALTER COLUMN has_ai_task DROP NOT NULL; | ||
ALTER TABLE workspace_builds ALTER COLUMN has_ai_task DROP DEFAULT; | ||
ALTER TABLE workspace_builds ALTER COLUMN has_ai_task DROP NOT NULL; |
Some generated files are not rendered by default. Learn more abouthow customized files appear on GitHub.
Uh oh!
There was an error while loading.Please reload this page.
Some generated files are not rendered by default. Learn more abouthow customized files appear on GitHub.
Uh oh!
There was an error while loading.Please reload this page.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1732,7 +1732,10 @@ func (api *API) postTemplateVersionsByOrganization(rw http.ResponseWriter, r *ht | ||
}, | ||
// appease the exhaustruct linter | ||
// TODO: set this to whether the template version defines a `coder_ai_task` tf resource | ||
HasAITask: sql.NullBool{ | ||
Bool: false, | ||
Valid: false, | ||
hugodutka marked this conversation as resolved. Show resolvedHide resolvedUh oh!There was an error while loading.Please reload this page. | ||
}, | ||
}) | ||
if err != nil { | ||
if database.IsUniqueViolation(err, database.UniqueTemplateVersionsTemplateIDNameKey) { | ||
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -427,7 +427,10 @@ func (b *Builder) buildTx(authFunc func(action policy.Action, object rbac.Object | ||
}, | ||
// appease the exhaustruct linter | ||
// TODO: set this to whether the build included a `coder_ai_task` tf resource | ||
HasAITask: sql.NullBool{ | ||
Bool: false, | ||
Valid: false, | ||
dannykopping marked this conversation as resolved. Show resolvedHide resolvedUh oh!There was an error while loading.Please reload this page. | ||
}, | ||
}) | ||
if err != nil { | ||
code := http.StatusInternalServerError | ||
Uh oh!
There was an error while loading.Please reload this page.