Skip to content

feat: add ai tasks migrations #18359

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 3 commits into from
Jun 13, 2025
Merged

feat: add ai tasks migrations #18359

merged 3 commits into from
Jun 13, 2025

Conversation

hugodutka
Copy link
Contributor

@hugodutka hugodutka commented Jun 13, 2025

Adds database migrations required for the Tasks feature.

There's a slight difference between the migrations in this PR and the RFC: this PR adds NOT NULL constraints to the has_ai_task columns. It was an oversight on my part when I wrote the RFC - I assumed the DEFAULT FALSE value would make the columns implicitly NOT NULL, but that's not the case with Postgres. We have no use for the NULL value.

The DEFAULT FALSE statement ensures that the migration will pass even when there are existing rows in the template version and workspace builds tables, so there's no danger in adding the NOT NULL constraints.

@hugodutka hugodutka force-pushed the hugodutka/ai-tasks-migrations branch from 101e894 to 2b15938 Compare June 13, 2025 12:57
@hugodutka hugodutka marked this pull request as ready for review June 13, 2025 13:16
@hugodutka hugodutka requested a review from dannykopping June 13, 2025 13:16
@@ -3355,6 +3355,7 @@ type TemplateVersion struct {
Message string `db:"message" json:"message"`
Archived bool `db:"archived" json:"archived"`
SourceExampleID sql.NullString `db:"source_example_id" json:"source_example_id"`
HasAiTask bool `db:"has_ai_task" json:"has_ai_task"`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: can you use sqlc to correct the naming here to HasAITask?

@hugodutka hugodutka force-pushed the hugodutka/ai-tasks-migrations branch from 2b15938 to e4e2035 Compare June 13, 2025 13:40
@hugodutka hugodutka force-pushed the hugodutka/ai-tasks-migrations branch from e4e2035 to 50f1008 Compare June 13, 2025 13:41
Copy link
Contributor

@dannykopping dannykopping left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 [linkspector] reported by reviewdog 🐶
Cannot reach https://splunk.com Status: null Navigation timeout of 30000 ms exceeded

categorized using any log management tool such as [Splunk](https://splunk.com).

@hugodutka hugodutka merged commit 8e29ee5 into main Jun 13, 2025
35 of 36 checks passed
@hugodutka hugodutka deleted the hugodutka/ai-tasks-migrations branch June 13, 2025 13:54
@github-actions github-actions bot locked and limited conversation to collaborators Jun 13, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants