8000 chore: make has_ai_task fields on workspace builds and template versions nullable by hugodutka · Pull Request #18403 · coder/coder · GitHub
[go: up one dir, main page]

Skip to content

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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jun 17, 2025
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
migrations
  • Loading branch information
hugodutka committed Jun 17, 2025
commit 5e90dc256658db4b6046f1c076243b45b490a608
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;
7 changes: 7 additions & 0 deletions coderd/database/migrations/000337_nullable_has_ai_task.up.sql
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;
0