feat: add ai tasks migrations (#18359)

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.
This commit is contained in:
Hugo Dutka
2025-06-13 15:54:02 +02:00
committed by GitHub
parent 0ef62264ba
commit 8e29ee50a3
9 changed files with 252 additions and 22 deletions
+2
View File
@@ -147,6 +147,8 @@ sql:
crypto_key_feature_workspace_apps_api_key: CryptoKeyFeatureWorkspaceAppsAPIKey
crypto_key_feature_oidc_convert: CryptoKeyFeatureOIDCConvert
stale_interval_ms: StaleIntervalMS
has_ai_task: HasAITask
ai_tasks_sidebar_app_id: AITasksSidebarAppID
rules:
- name: do-not-use-public-schema-in-queries
message: "do not use public schema in queries"