Skip to content

armgit / kaneo

Public Imported from GitHub
0

⚡ Project management that doesn't become the project. Boards, Gantt charts, and GitHub integration. Self-host it or use Kaneo Cloud.

feat(custom-fields): hide retired selection options

Tin2224927c7d16
diff --git a/apps/api/drizzle/0064_custom_field_hidden_options.sql b/apps/api/drizzle/0064_custom_field_hidden_options.sql
new file mode 100644
index 000000000..3d9e78cae
--- /dev/null
+++ b/apps/api/drizzle/0064_custom_field_hidden_options.sql
@@ -0,0 +1 @@
+ALTER TABLE "custom_field_definition" ADD COLUMN "hidden_options" jsonb DEFAULT '[]'::jsonb NOT NULL;
\ No newline at end of file
diff --git a/apps/api/drizzle/meta/0064_snapshot.json b/apps/api/drizzle/meta/0064_snapshot.json
new file mode 100644
index 000000000..19c173860
--- /dev/null
+++ b/apps/api/drizzle/meta/0064_snapshot.json
@@ -0,0 +1,5398 @@
+{
+ "id": "c1e91718-d7d9-4e95-a7a0-c687aca3240c",
+ "prevId": "f569b31a-0316-4069-acb6-0443dcf0a86f",
+ "version": "7",
+ "dialect": "postgresql",
+ "tables": {
+ "public.account": {
+ "name": "account",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "account_id": {
+ "name": "account_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "provider_id": {
+ "name": "provider_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "access_token": {
+ "name": "access_token",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "refresh_token": {
+ "name": "refresh_token",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "id_token": {
+ "name": "id_token",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "access_token_expires_at": {
+ "name": "access_token_expires_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "refresh_token_expires_at": {
+ "name": "refresh_token_expires_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "scope": {
+ "name": "scope",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "password": {
+ "name": "password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "(now() AT TIME ZONE 'utc')"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "account_userId_idx": {
+ "name": "account_userId_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "account_user_id_user_id_fk": {
+ "name": "account_user_id_user_id_fk",
+ "tableFrom": "account",
+ "tableTo": "user",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.activity": {
+ "name": "activity",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "task_id": {
+ "name": "task_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "type": {
+ "name": "type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "(now() AT TIME ZONE 'utc')"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "(now() AT TIME ZONE 'utc')"
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "content": {
+ "name": "content",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "event_data": {
+ "name": "event_data",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "external_user_name": {
+ "name": "external_user_name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "external_user_avatar": {
+ "name": "external_user_avatar",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "external_source": {
+ "name": "external_source",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "external_url": {
+ "name": "external_url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {
+ "activity_task_id_idx": {
+ "name": "activity_task_id_idx",
+ "columns": [
+ {
+ "expression": "task_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "activity_userId_idx": {
+ "name": "activity_userId_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "activity_createdAt_idx": {
+ "name": "activity_createdAt_idx",
+ "columns": [
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "activity_task_id_task_id_fk": {
+ "name": "activity_task_id_task_id_fk",
+ "tableFrom": "activity",
+ "tableTo": "task",
+ "columnsFrom": [
+ "task_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "cascade"
+ },
+ "activity_user_id_user_id_fk": {
+ "name": "activity_user_id_user_id_fk",
+ "tableFrom": "activity",
+ "tableTo": "user",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "cascade"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "activity_task_external_source_external_url_unique": {
+ "name": "activity_task_external_source_external_url_unique",
+ "nullsNotDistinct": false,
+ "columns": [
+ "task_id",
+ "external_source",
+ "external_url"
+ ]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.apikey": {
+ "name": "apikey",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "config_id": {
+ "name": "config_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'default'"
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "start": {
+ "name": "start",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "reference_id": {
+ "name": "reference_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "prefix": {
+ "name": "prefix",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "key": {
+ "name": "key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "refill_interval": {
+ "name": "refill_interval",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "refill_amount": {
+ "name": "refill_amount",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "last_refill_at": {
+ "name": "last_refill_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "enabled": {
+ "name": "enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "default": true
+ },
+ "rate_limit_enabled": {
+ "name": "rate_limit_enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "default": true
+ },
+ "rate_limit_time_window": {
+ "name": "rate_limit_time_window",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "default": 86400000
+ },
+ "rate_limit_max": {
+ "name": "rate_limit_max",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "default": 10
+ },
+ "request_count": {
+ "name": "request_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "default": 0
+ },
+ "remaining": {
+ "name": "remaining",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "last_request": {
+ "name": "last_request",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "permissions": {
+ "name": "permissions",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "metadata": {
+ "name": "metadata",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {
+ "apikey_configId_idx": {
+ "name": "apikey_configId_idx",
+ "columns": [
+ {
+ "expression": "config_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "apikey_key_idx": {
+ "name": "apikey_key_idx",
+ "columns": [
+ {
+ "expression": "key",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "apikey_referenceId_idx": {
+ "name": "apikey_referenceId_idx",
+ "columns": [
+ {
+ "expression": "reference_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "apikey_userId_idx": {
+ "name": "apikey_userId_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "apikey_reference_id_user_id_fk": {
+ "name": "apikey_reference_id_user_id_fk",
+ "tableFrom": "apikey",
+ "tableTo": "user",
+ "columnsFrom": [
+ "reference_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "apikey_user_id_user_id_fk": {
+ "name": "apikey_user_id_user_id_fk",
+ "tableFrom": "apikey",
+ "tableTo": "user",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.asset": {
+ "name": "asset",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "project_id": {
+ "name": "project_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "task_id": {
+ "name": "task_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "activity_id": {
+ "name": "activity_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "object_key": {
+ "name": "object_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "filename": {
+ "name": "filename",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "mime_type": {
+ "name": "mime_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "size": {
+ "name": "size",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "kind": {
+ "name": "kind",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'image'"
+ },
+ "surface": {
+ "name": "surface",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'description'"
+ },
+ "created_by": {
+ "name": "created_by",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "(now() AT TIME ZONE 'utc')"
+ }
+ },
+ "indexes": {
+ "asset_workspaceId_idx": {
+ "name": "asset_workspaceId_idx",
+ "columns": [
+ {
+ "expression": "workspace_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "asset_projectId_idx": {
+ "name": "asset_projectId_idx",
+ "columns": [
+ {
+ "expression": "project_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "asset_taskId_idx": {
+ "name": "asset_taskId_idx",
+ "columns": [
+ {
+ "expression": "task_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "asset_activityId_idx": {
+ "name": "asset_activityId_idx",
+ "columns": [
+ {
+ "expression": "activity_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "asset_createdBy_idx": {
+ "name": "asset_createdBy_idx",
+ "columns": [
+ {
+ "expression": "created_by",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "asset_draft_expiry_idx": {
+ "name": "asset_draft_expiry_idx",
+ "columns": [
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "where": "\"asset\".\"task_id\" is null and \"asset\".\"surface\" in ('draft', 'draft-pending')",
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "asset_workspace_id_workspace_id_fk": {
+ "name": "asset_workspace_id_workspace_id_fk",
+ "tableFrom": "asset",
+ "tableTo": "workspace",
+ "columnsFrom": [
+ "workspace_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "cascade"
+ },
+ "asset_project_id_project_id_fk": {
+ "name": "asset_project_id_project_id_fk",
+ "tableFrom": "asset",
+ "tableTo": "project",
+ "columnsFrom": [
+ "project_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "cascade"
+ },
+ "asset_task_id_task_id_fk": {
+ "name": "asset_task_id_task_id_fk",
+ "tableFrom": "asset",
+ "tableTo": "task",
+ "columnsFrom": [
+ "task_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "cascade"
+ },
+ "asset_activity_id_activity_id_fk": {
+ "name": "asset_activity_id_activity_id_fk",
+ "tableFrom": "asset",
+ "tableTo": "activity",
+ "columnsFrom": [
+ "activity_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "cascade"
+ },
+ "asset_created_by_user_id_fk": {
+ "name": "asset_created_by_user_id_fk",
+ "tableFrom": "asset",
+ "tableTo": "user",
+ "columnsFrom": [
+ "created_by"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "cascade"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "asset_object_key_unique": {
+ "name": "asset_object_key_unique",
+ "nullsNotDistinct": false,
+ "columns": [
+ "object_key"
+ ]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.billing_event": {
+ "name": "billing_event",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "event_type": {
+ "name": "event_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "processed_at": {
+ "name": "processed_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "(now() AT TIME ZONE 'utc')"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.billing_reminder_sent": {
+ "name": "billing_reminder_sent",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "reminder_type": {
+ "name": "reminder_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "trial_ends_at": {
+ "name": "trial_ends_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "(now() AT TIME ZONE 'utc')"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "(now() AT TIME ZONE 'utc')"
+ }
+ },
+ "indexes": {
+ "billing_reminder_sent_workspaceId_idx": {
+ "name": "billing_reminder_sent_workspaceId_idx",
+ "columns": [
+ {
+ "expression": "workspace_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "billing_reminder_sent_userId_idx": {
+ "name": "billing_reminder_sent_userId_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "billing_reminder_sent_user_id_user_id_fk": {
+ "name": "billing_reminder_sent_user_id_user_id_fk",
+ "tableFrom": "billing_reminder_sent",
+ "tableTo": "user",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "cascade"
+ },
+ "billing_reminder_sent_workspace_id_workspace_id_fk": {
+ "name": "billing_reminder_sent_workspace_id_workspace_id_fk",
+ "tableFrom": "billing_reminder_sent",
+ "tableTo": "workspace",
+ "columnsFrom": [
+ "workspace_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "cascade"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "billing_reminder_sent_user_type_unique": {
+ "name": "billing_reminder_sent_user_type_unique",
+ "nullsNotDistinct": false,
+ "columns": [
+ "user_id",
+ "reminder_type"
+ ]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.calendar_feed": {
+ "name": "calendar_feed",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "project_id": {
+ "name": "project_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "token": {
+ "name": "token",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "label_ids": {
+ "name": "label_ids",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "time_zone": {
+ "name": "time_zone",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'UTC'"
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "(now() AT TIME ZONE 'utc')"
+ }
+ },
+ "indexes": {
+ "calendar_feed_project_id_idx": {
+ "name": "calendar_feed_project_id_idx",
+ "columns": [
+ {
+ "expression": "project_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "calendar_feed_project_id_project_id_fk": {
+ "name": "calendar_feed_project_id_project_id_fk",
+ "tableFrom": "calendar_feed",
+ "tableTo": "project",
+ "columnsFrom": [
+ "project_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "cascade"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "calendar_feed_token_unique": {
+ "name": "calendar_feed_token_unique",
+ "nullsNotDistinct": false,
+ "columns": [
+ "token"
+ ]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.column": {
+ "name": "column",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "project_id": {
+ "name": "project_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "slug": {
+ "name": "slug",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "position": {
+ "name": "position",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "icon": {
+ "name": "icon",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "color": {
+ "name": "color",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "is_final": {
+ "name": "is_final",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "(now() AT TIME ZONE 'utc')"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "(now() AT TIME ZONE 'utc')"
+ }
+ },
+ "indexes": {
+ "column_projectId_idx": {
+ "name": "column_projectId_idx",
+ "columns": [
+ {
+ "expression": "project_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "column_project_id_project_id_fk": {
+ "name": "column_project_id_project_id_fk",
+ "tableFrom": "column",
+ "tableTo": "project",
+ "columnsFrom": [
+ "project_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "cascade"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.comment": {
+ "name": "comment",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "task_id": {
+ "name": "task_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "content": {
+ "name": "content",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "(now() AT TIME ZONE 'utc')"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "(now() AT TIME ZONE 'utc')"
+ }
+ },
+ "indexes": {
+ "comment_task_idx": {
+ "name": "comment_task_idx",
+ "columns": [
+ {
+ "expression": "task_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "comment_user_idx": {
+ "name": "comment_user_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "comment_task_id_task_id_fk": {
+ "name": "comment_task_id_task_id_fk",
+ "tableFrom": "comment",
+ "tableTo": "task",
+ "columnsFrom": [
+ "task_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "cascade"
+ },
+ "comment_user_id_user_id_fk": {
+ "name": "comment_user_id_user_id_fk",
+ "tableFrom": "comment",
+ "tableTo": "user",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "cascade"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.custom_field_definition": {
+ "name": "custom_field_definition",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "project_id": {
+ "name": "project_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "type": {
+ "name": "type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "required": {
+ "name": "required",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "default_value": {
+ "name": "default_value",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "options": {
+ "name": "options",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "hidden_options": {
+ "name": "hidden_options",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'[]'::jsonb"
+ },
+ "position": {
+ "name": "position",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "(now() AT TIME ZONE 'utc')"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "(now() AT TIME ZONE 'utc')"
+ }
+ },
+ "indexes": {
+ "custom_field_def_projectId_idx": {
+ "name": "custom_field_def_projectId_idx",
+ "columns": [
+ {
+ "expression": "project_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "custom_field_definition_project_id_project_id_fk": {
+ "name": "custom_field_definition_project_id_project_id_fk",
+ "tableFrom": "custom_field_definition",
+ "tableTo": "project",
+ "columnsFrom": [
+ "project_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "cascade"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.custom_field_value": {
+ "name": "custom_field_value",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "task_id": {
+ "name": "task_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "field_id": {
+ "name": "field_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "value": {
+ "name": "value",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "(now() AT TIME ZONE 'utc')"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "(now() AT TIME ZONE 'utc')"
+ }
+ },
+ "indexes": {
+ "custom_field_value_taskId_idx": {
+ "name": "custom_field_value_taskId_idx",
+ "columns": [
+ {
+ "expression": "task_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "custom_field_value_fieldId_idx": {
+ "name": "custom_field_value_fieldId_idx",
+ "columns": [
+ {
+ "expression": "field_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "custom_field_value_task_id_task_id_fk": {
+ "name": "custom_field_value_task_id_task_id_fk",
+ "tableFrom": "custom_field_value",
+ "tableTo": "task",
+ "columnsFrom": [
+ "task_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "cascade"
+ },
+ "custom_field_value_field_id_custom_field_definition_id_fk": {
+ "name": "custom_field_value_field_id_custom_field_definition_id_fk",
+ "tableFrom": "custom_field_value",
+ "tableTo": "custom_field_definition",
+ "columnsFrom": [
+ "field_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "cascade"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "custom_field_value_task_field_unique": {
+ "name": "custom_field_value_task_field_unique",
+ "nullsNotDistinct": false,
+ "columns": [
+ "task_id",
+ "field_id"
+ ]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.data_migration": {
+ "name": "data_migration",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "completed_at": {
+ "name": "completed_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "(now() AT TIME ZONE 'utc')"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.device_code": {
+ "name": "device_code",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "device_code": {
+ "name": "device_code",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_code": {
+ "name": "user_code",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "(now() AT TIME ZONE 'utc')"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "(now() AT TIME ZONE 'utc')"
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "status": {
+ "name": "status",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "last_polled_at": {
+ "name": "last_polled_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "polling_interval": {
+ "name": "polling_interval",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "client_id": {
+ "name": "client_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "scope": {
+ "name": "scope",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {
+ "device_code_device_code_uidx": {
+ "name": "device_code_device_code_uidx",
+ "columns": [
+ {
+ "expression": "device_code",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "device_code_user_code_uidx": {
+ "name": "device_code_user_code_uidx",
+ "columns": [
+ {
+ "expression": "user_code",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "device_code_user_id_idx": {
+ "name": "device_code_user_id_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "device_code_user_id_user_id_fk": {
+ "name": "device_code_user_id_user_id_fk",
+ "tableFrom": "device_code",
+ "tableTo": "user",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "cascade"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.external_link": {
+ "name": "external_link",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "task_id": {
+ "name": "task_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "integration_id": {
+ "name": "integration_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "resource_type": {
+ "name": "resource_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "external_id": {
+ "name": "external_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "url": {
+ "name": "url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "title": {
+ "name": "title",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "metadata": {
+ "name": "metadata",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "(now() AT TIME ZONE 'utc')"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "(now() AT TIME ZONE 'utc')"
+ }
+ },
+ "indexes": {
+ "external_link_taskId_idx": {
+ "name": "external_link_taskId_idx",
+ "columns": [
+ {
+ "expression": "task_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "external_link_integrationId_idx": {
+ "name": "external_link_integrationId_idx",
+ "columns": [
+ {
+ "expression": "integration_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "external_link_externalId_idx": {
+ "name": "external_link_externalId_idx",
+ "columns": [
+ {
+ "expression": "external_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "external_link_resourceType_idx": {
+ "name": "external_link_resourceType_idx",
+ "columns": [
+ {
+ "expression": "resource_type",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "external_link_deferred_issue_idx": {
+ "name": "external_link_deferred_issue_idx",
+ "columns": [
+ {
+ "expression": "id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "where": "\"external_link\".\"resource_type\" = 'issue' AND \"external_link\".\"metadata\" LIKE '%\"deferredIssueEdit\":%'",
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "external_link_task_id_task_id_fk": {
+ "name": "external_link_task_id_task_id_fk",
+ "tableFrom": "external_link",
+ "tableTo": "task",
+ "columnsFrom": [
+ "task_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "cascade"
+ },
+ "external_link_integration_id_integration_id_fk": {
+ "name": "external_link_integration_id_integration_id_fk",
+ "tableFrom": "external_link",
+ "tableTo": "integration",
+ "columnsFrom": [
+ "integration_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "cascade"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.github_import": {
+ "name": "github_import",
+ "schema": "",
+ "columns": {
+ "integration_id": {
+ "name": "integration_id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "run_id": {
+ "name": "run_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "state": {
+ "name": "state",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "(now() AT TIME ZONE 'utc')"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "github_import_integration_id_integration_id_fk": {
+ "name": "github_import_integration_id_integration_id_fk",
+ "tableFrom": "github_import",
+ "tableTo": "integration",
+ "columnsFrom": [
+ "integration_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "cascade"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.github_integration": {
+ "name": "github_integration",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "project_id": {
+ "name": "project_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "repository_owner": {
+ "name": "repository_owner",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "repository_name": {
+ "name": "repository_name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "installation_id": {
+ "name": "installation_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "is_active": {
+ "name": "is_active",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "default": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "github_integration_project_id_project_id_fk": {
+ "name": "github_integration_project_id_project_id_fk",
+ "tableFrom": "github_integration",
+ "tableTo": "project",
+ "columnsFrom": [
+ "project_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "cascade"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "github_integration_project_id_unique": {
+ "name": "github_integration_project_id_unique",
+ "nullsNotDistinct": false,
+ "columns": [
+ "project_id"
+ ]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.import_run": {
+ "name": "import_run",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "source": {
+ "name": "source",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "status": {
+ "name": "status",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'running'"
+ },
+ "include_comments": {
+ "name": "include_comments",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": true
+ },
+ "message": {
+ "name": "message",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "projects": {
+ "name": "projects",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "error": {
+ "name": "error",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "heartbeat_at": {
+ "name": "heartbeat_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "(now() AT TIME ZONE 'utc')"
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "(now() AT TIME ZONE 'utc')"
+ },
+ "finished_at": {
+ "name": "finished_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {
+ "import_run_workspace_created_idx": {
+ "name": "import_run_workspace_created_idx",
+ "columns": [
+ {
+ "expression": "workspace_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "import_run_workspace_id_workspace_id_fk": {
+ "name": "import_run_workspace_id_workspace_id_fk",
+ "tableFrom": "import_run",
+ "tableTo": "workspace",
+ "columnsFrom": [
+ "workspace_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "cascade"
+ },
+ "import_run_user_id_user_id_fk": {
+ "name": "import_run_user_id_user_id_fk",
+ "tableFrom": "import_run",
+ "tableTo": "user",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "cascade"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.integration": {
+ "name": "integration",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "project_id": {
+ "name": "project_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "type": {
+ "name": "type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "config": {
+ "name": "config",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "is_active": {
+ "name": "is_active",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "default": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "(now() AT TIME ZONE 'utc')"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "(now() AT TIME ZONE 'utc')"
+ }
+ },
+ "indexes": {
+ "integration_projectId_idx": {
+ "name": "integration_projectId_idx",
+ "columns": [
+ {
+ "expression": "project_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "integration_type_idx": {
+ "name": "integration_type_idx",
+ "columns": [
+ {
+ "expression": "type",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "integration_project_id_project_id_fk": {
+ "name": "integration_project_id_project_id_fk",
+ "tableFrom": "integration",
+ "tableTo": "project",
+ "columnsFrom": [
+ "project_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "cascade"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "integration_project_type_unique": {
+ "name": "integration_project_type_unique",
+ "nullsNotDistinct": false,
+ "columns": [
+ "project_id",
+ "type"
+ ]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.invitation": {
+ "name": "invitation",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "email": {
+ "name": "email",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "role": {
+ "name": "role",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "team_id": {
+ "name": "team_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "status": {
+ "name": "status",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'pending'"
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "(now() AT TIME ZONE 'utc')"
+ },
+ "inviter_id": {
+ "name": "inviter_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "project_access": {
+ "name": "project_access",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'all'"
+ },
+ "project_ids": {
+ "name": "project_ids",
+ "type": "text[]",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'{}'::text[]"
+ }
+ },
+ "indexes": {
+ "invitation_workspaceId_idx": {
+ "name": "invitation_workspaceId_idx",
+ "columns": [
+ {
+ "expression": "workspace_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "invitation_email_idx": {
+ "name": "invitation_email_idx",
+ "columns": [
+ {
+ "expression": "email",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "invitation_inviterId_idx": {
+ "name": "invitation_inviterId_idx",
+ "columns": [
+ {
+ "expression": "inviter_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "invitation_workspace_id_workspace_id_fk": {
+ "name": "invitation_workspace_id_workspace_id_fk",
+ "tableFrom": "invitation",
+ "tableTo": "workspace",
+ "columnsFrom": [
+ "workspace_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "invitation_inviter_id_user_id_fk": {
+ "name": "invitation_inviter_id_user_id_fk",
+ "tableFrom": "invitation",
+ "tableTo": "user",
+ "columnsFrom": [
+ "inviter_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.job_lease": {
+ "name": "job_lease",
+ "schema": "",
+ "columns": {
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "owner": {
+ "name": "owner",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.label": {
+ "name": "label",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "color": {
+ "name": "color",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "(now() AT TIME ZONE 'utc')"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "(now() AT TIME ZONE 'utc')"
+ },
+ "deletion_started_at": {
+ "name": "deletion_started_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "task_id": {
+ "name": "task_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {
+ "label_task_id_idx": {
+ "name": "label_task_id_idx",
+ "columns": [
+ {
+ "expression": "task_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "label_workspace_id_idx": {
+ "name": "label_workspace_id_idx",
+ "columns": [
+ {
+ "expression": "workspace_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "label_workspace_cascade_idx": {
+ "name": "label_workspace_cascade_idx",
+ "columns": [
+ {
+ "expression": "workspace_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "name",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "where": "\"label\".\"task_id\" is not null",
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "label_workspace_name_unique": {
+ "name": "label_workspace_name_unique",
+ "columns": [
+ {
+ "expression": "workspace_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "name",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "where": "\"label\".\"task_id\" is null",
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "label_task_id_task_id_fk": {
+ "name": "label_task_id_task_id_fk",
+ "tableFrom": "label",
+ "tableTo": "task",
+ "columnsFrom": [
+ "task_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "cascade"
+ },
+ "label_workspace_id_workspace_id_fk": {
+ "name": "label_workspace_id_workspace_id_fk",
+ "tableFrom": "label",
+ "tableTo": "workspace",
+ "columnsFrom": [
+ "workspace_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "cascade"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "label_task_name_unique": {
+ "name": "label_task_name_unique",
+ "nullsNotDistinct": false,
+ "columns": [
+ "task_id",
+ "name"
+ ]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.mcp_oauth_state": {
+ "name": "mcp_oauth_state",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "kind": {
+ "name": "kind",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "key": {
+ "name": "key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "payload": {
+ "name": "payload",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "(now() AT TIME ZONE 'utc')"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "(now() AT TIME ZONE 'utc')"
+ }
+ },
+ "indexes": {
+ "mcp_oauth_state_kind_key_uidx": {
+ "name": "mcp_oauth_state_kind_key_uidx",
+ "columns": [
+ {
+ "expression": "kind",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "key",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "mcp_oauth_state_expiresAt_idx": {
+ "name": "mcp_oauth_state_expiresAt_idx",
+ "columns": [
+ {
+ "expression": "expires_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.notification": {
+ "name": "notification",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "title": {
+ "name": "title",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "content": {
+ "name": "content",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "type": {
+ "name": "type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'info'"
+ },
+ "event_data": {
+ "name": "event_data",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "is_read": {
+ "name": "is_read",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "default": false
+ },
+ "resource_id": {
+ "name": "resource_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "resource_type": {
+ "name": "resource_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "notification_userId_idx": {
+ "name": "notification_userId_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "notification_user_id_user_id_fk": {
+ "name": "notification_user_id_user_id_fk",
+ "tableFrom": "notification",
+ "tableTo": "user",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "cascade"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.workspace_role": {
+ "name": "workspace_role",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "role": {
+ "name": "role",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "permission": {
+ "name": "permission",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "(now() AT TIME ZONE 'utc')"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "(now() AT TIME ZONE 'utc')"
+ }
+ },
+ "indexes": {
+ "workspace_role_workspaceId_idx": {
+ "name": "workspace_role_workspaceId_idx",
+ "columns": [
+ {
+ "expression": "workspace_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "workspace_role_role_idx": {
+ "name": "workspace_role_role_idx",
+ "columns": [
+ {
+ "expression": "role",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "workspace_role_workspace_id_workspace_id_fk": {
+ "name": "workspace_role_workspace_id_workspace_id_fk",
+ "tableFrom": "workspace_role",
+ "tableTo": "workspace",
+ "columnsFrom": [
+ "workspace_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "cascade"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.project": {
+ "name": "project",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "slug": {
+ "name": "slug",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "icon": {
+ "name": "icon",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "default": "'Layout'"
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "description": {
+ "name": "description",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "(now() AT TIME ZONE 'utc')"
+ },
+ "is_public": {
+ "name": "is_public",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "default": false
+ },
+ "archived_at": {
+ "name": "archived_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "last_task_number": {
+ "name": "last_task_number",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "position": {
+ "name": "position",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "background_object_key": {
+ "name": "background_object_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "background_mime_type": {
+ "name": "background_mime_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "background_version": {
+ "name": "background_version",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {
+ "project_background_object_key_idx": {
+ "name": "project_background_object_key_idx",
+ "columns": [
+ {
+ "expression": "background_object_key",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "where": "\"project\".\"background_object_key\" is not null",
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "project_workspaceId_position_idx": {
+ "name": "project_workspaceId_position_idx",
+ "columns": [
+ {
+ "expression": "workspace_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "position",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "project_workspace_id_workspace_id_fk": {
+ "name": "project_workspace_id_workspace_id_fk",
+ "tableFrom": "project",
+ "tableTo": "workspace",
+ "columnsFrom": [
+ "workspace_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "cascade"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "project_workspace_id_id_unique": {
+ "name": "project_workspace_id_id_unique",
+ "nullsNotDistinct": false,
+ "columns": [
+ "workspace_id",
+ "id"
+ ]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.session": {
+ "name": "session",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "token": {
+ "name": "token",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "(now() AT TIME ZONE 'utc')"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "ip_address": {
+ "name": "ip_address",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "user_agent": {
+ "name": "user_agent",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "active_organization_id": {
+ "name": "active_organization_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "active_team_id": {
+ "name": "active_team_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "impersonated_by": {
+ "name": "impersonated_by",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {
+ "session_userId_idx": {
+ "name": "session_userId_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "session_user_id_user_id_fk": {
+ "name": "session_user_id_user_id_fk",
+ "tableFrom": "session",
+ "tableTo": "user",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "session_token_unique": {
+ "name": "session_token_unique",
+ "nullsNotDistinct": false,
+ "columns": [
+ "token"
+ ]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.storage_cleanup": {
+ "name": "storage_cleanup",
+ "schema": "",
+ "columns": {
+ "object_key": {
+ "name": "object_key",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "last_attempt_at": {
+ "name": "last_attempt_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "(now() AT TIME ZONE 'utc')"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.task_relation": {
+ "name": "task_relation",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "source_task_id": {
+ "name": "source_task_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "target_task_id": {
+ "name": "target_task_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "relation_type": {
+ "name": "relation_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "(now() AT TIME ZONE 'utc')"
+ }
+ },
+ "indexes": {
+ "task_relation_source_idx": {
+ "name": "task_relation_source_idx",
+ "columns": [
+ {
+ "expression": "source_task_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "task_relation_target_idx": {
+ "name": "task_relation_target_idx",
+ "columns": [
+ {
+ "expression": "target_task_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "task_relation_source_task_id_task_id_fk": {
+ "name": "task_relation_source_task_id_task_id_fk",
+ "tableFrom": "task_relation",
+ "tableTo": "task",
+ "columnsFrom": [
+ "source_task_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "cascade"
+ },
+ "task_relation_target_task_id_task_id_fk": {
+ "name": "task_relation_target_task_id_task_id_fk",
+ "tableFrom": "task_relation",
+ "tableTo": "task",
+ "columnsFrom": [
+ "target_task_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "cascade"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.task_reminder_sent": {
+ "name": "task_reminder_sent",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "task_id": {
+ "name": "task_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "reminder_type": {
+ "name": "reminder_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "(now() AT TIME ZONE 'utc')"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "(now() AT TIME ZONE 'utc')"
+ }
+ },
+ "indexes": {
+ "task_reminder_sent_taskId_idx": {
+ "name": "task_reminder_sent_taskId_idx",
+ "columns": [
+ {
+ "expression": "task_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "task_reminder_sent_task_id_task_id_fk": {
+ "name": "task_reminder_sent_task_id_task_id_fk",
+ "tableFrom": "task_reminder_sent",
+ "tableTo": "task",
+ "columnsFrom": [
+ "task_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "cascade"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "task_reminder_sent_task_type_unique": {
+ "name": "task_reminder_sent_task_type_unique",
+ "nullsNotDistinct": false,
+ "columns": [
+ "task_id",
+ "reminder_type"
+ ]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.task": {
+ "name": "task",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "project_id": {
+ "name": "project_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "position": {
+ "name": "position",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "default": 0
+ },
+ "number": {
+ "name": "number",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "default": 1
+ },
+ "assignee_id": {
+ "name": "assignee_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "title": {
+ "name": "title",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "description": {
+ "name": "description",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "status": {
+ "name": "status",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'to-do'"
+ },
+ "column_id": {
+ "name": "column_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "priority": {
+ "name": "priority",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'low'"
+ },
+ "start_date": {
+ "name": "start_date",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "due_date": {
+ "name": "due_date",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "(now() AT TIME ZONE 'utc')"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "(now() AT TIME ZONE 'utc')"
+ }
+ },
+ "indexes": {
+ "task_projectId_idx": {
+ "name": "task_projectId_idx",
+ "columns": [
+ {
+ "expression": "project_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "task_project_scheduled_id_idx": {
+ "name": "task_project_scheduled_id_idx",
+ "columns": [
+ {
+ "expression": "project_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "where": "\"task\".\"start_date\" is not null or \"task\".\"due_date\" is not null",
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "task_dueDate_idx": {
+ "name": "task_dueDate_idx",
+ "columns": [
+ {
+ "expression": "due_date",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "task_assigneeId_idx": {
+ "name": "task_assigneeId_idx",
+ "columns": [
+ {
+ "expression": "assignee_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "task_columnId_idx": {
+ "name": "task_columnId_idx",
+ "columns": [
+ {
+ "expression": "column_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "task_project_id_project_id_fk": {
+ "name": "task_project_id_project_id_fk",
+ "tableFrom": "task",
+ "tableTo": "project",
+ "columnsFrom": [
+ "project_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "cascade"
+ },
+ "task_assignee_id_user_id_fk": {
+ "name": "task_assignee_id_user_id_fk",
+ "tableFrom": "task",
+ "tableTo": "user",
+ "columnsFrom": [
+ "assignee_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "cascade"
+ },
+ "task_column_id_column_id_fk": {
+ "name": "task_column_id_column_id_fk",
+ "tableFrom": "task",
+ "tableTo": "column",
+ "columnsFrom": [
+ "column_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "cascade"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "task_project_number_unique": {
+ "name": "task_project_number_unique",
+ "nullsNotDistinct": false,
+ "columns": [
+ "project_id",
+ "number"
+ ]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.team": {
+ "name": "team",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {
+ "team_workspaceId_idx": {
+ "name": "team_workspaceId_idx",
+ "columns": [
+ {
+ "expression": "workspace_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "team_workspace_id_workspace_id_fk": {
+ "name": "team_workspace_id_workspace_id_fk",
+ "tableFrom": "team",
+ "tableTo": "workspace",
+ "columnsFrom": [
+ "workspace_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.team_member": {
+ "name": "team_member",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "team_id": {
+ "name": "team_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {
+ "teamMember_teamId_idx": {
+ "name": "teamMember_teamId_idx",
+ "columns": [
+ {
+ "expression": "team_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "teamMember_userId_idx": {
+ "name": "teamMember_userId_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "team_member_team_id_team_id_fk": {
+ "name": "team_member_team_id_team_id_fk",
+ "tableFrom": "team_member",
+ "tableTo": "team",
+ "columnsFrom": [
+ "team_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "team_member_user_id_user_id_fk": {
+ "name": "team_member_user_id_user_id_fk",
+ "tableFrom": "team_member",
+ "tableTo": "user",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.time_entry": {
+ "name": "time_entry",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "task_id": {
+ "name": "task_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "description": {
+ "name": "description",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "start_time": {
+ "name": "start_time",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "end_time": {
+ "name": "end_time",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "duration": {
+ "name": "duration",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "default": 0
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "(now() AT TIME ZONE 'utc')"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "(now() AT TIME ZONE 'utc')"
+ }
+ },
+ "indexes": {
+ "time_entry_taskId_idx": {
+ "name": "time_entry_taskId_idx",
+ "columns": [
+ {
+ "expression": "task_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "time_entry_userId_idx": {
+ "name": "time_entry_userId_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "time_entry_task_id_task_id_fk": {
+ "name": "time_entry_task_id_task_id_fk",
+ "tableFrom": "time_entry",
+ "tableTo": "task",
+ "columnsFrom": [
+ "task_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "cascade"
+ },
+ "time_entry_user_id_user_id_fk": {
+ "name": "time_entry_user_id_user_id_fk",
+ "tableFrom": "time_entry",
+ "tableTo": "user",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "cascade"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.trial_grant": {
+ "name": "trial_grant",
+ "schema": "",
+ "columns": {
+ "email_hash": {
+ "name": "email_hash",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "trial_ends_at": {
+ "name": "trial_ends_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "(now() AT TIME ZONE 'utc')"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.user": {
+ "name": "user",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "email": {
+ "name": "email",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "email_verified": {
+ "name": "email_verified",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "image": {
+ "name": "image",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "locale": {
+ "name": "locale",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "(now() AT TIME ZONE 'utc')"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "(now() AT TIME ZONE 'utc')"
+ },
+ "is_anonymous": {
+ "name": "is_anonymous",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "default": false
+ },
+ "role": {
+ "name": "role",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "banned": {
+ "name": "banned",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "default": false
+ },
+ "ban_reason": {
+ "name": "ban_reason",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ban_expires": {
+ "name": "ban_expires",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "user_email_unique": {
+ "name": "user_email_unique",
+ "nullsNotDistinct": false,
+ "columns": [
+ "email"
+ ]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.user_avatar": {
+ "name": "user_avatar",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "mime_type": {
+ "name": "mime_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "size": {
+ "name": "size",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "data": {
+ "name": "data",
+ "type": "bytea",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "(now() AT TIME ZONE 'utc')"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "(now() AT TIME ZONE 'utc')"
+ }
+ },
+ "indexes": {
+ "user_avatar_userId_idx": {
+ "name": "user_avatar_userId_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "user_avatar_user_id_user_id_fk": {
+ "name": "user_avatar_user_id_user_id_fk",
+ "tableFrom": "user_avatar",
+ "tableTo": "user",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "cascade"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "user_avatar_user_id_unique": {
+ "name": "user_avatar_user_id_unique",
+ "nullsNotDistinct": false,
+ "columns": [
+ "user_id"
+ ]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.user_notification_preference": {
+ "name": "user_notification_preference",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "email_enabled": {
+ "name": "email_enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "ntfy_enabled": {
+ "name": "ntfy_enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "ntfy_server_url": {
+ "name": "ntfy_server_url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ntfy_topic": {
+ "name": "ntfy_topic",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ntfy_token": {
+ "name": "ntfy_token",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "gotify_enabled": {
+ "name": "gotify_enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "gotify_server_url": {
+ "name": "gotify_server_url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "gotify_token": {
+ "name": "gotify_token",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "webhook_enabled": {
+ "name": "webhook_enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "webhook_url": {
+ "name": "webhook_url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "webhook_secret": {
+ "name": "webhook_secret",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "task_assignment_enabled": {
+ "name": "task_assignment_enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": true
+ },
+ "task_comment_enabled": {
+ "name": "task_comment_enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": true
+ },
+ "task_status_change_enabled": {
+ "name": "task_status_change_enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": true
+ },
+ "due_date_reminder_enabled": {
+ "name": "due_date_reminder_enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": true
+ },
+ "due_date_reminder_lead_time_minutes": {
+ "name": "due_date_reminder_lead_time_minutes",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 1440
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "(now() AT TIME ZONE 'utc')"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "(now() AT TIME ZONE 'utc')"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "user_notification_preference_user_id_user_id_fk": {
+ "name": "user_notification_preference_user_id_user_id_fk",
+ "tableFrom": "user_notification_preference",
+ "tableTo": "user",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "cascade"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "user_notification_preference_user_id_unique": {
+ "name": "user_notification_preference_user_id_unique",
+ "nullsNotDistinct": false,
+ "columns": [
+ "user_id"
+ ]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.user_notification_workspace_project": {
+ "name": "user_notification_workspace_project",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "workspace_rule_id": {
+ "name": "workspace_rule_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "project_id": {
+ "name": "project_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "(now() AT TIME ZONE 'utc')"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "(now() AT TIME ZONE 'utc')"
+ }
+ },
+ "indexes": {
+ "user_notification_workspace_project_ruleId_idx": {
+ "name": "user_notification_workspace_project_ruleId_idx",
+ "columns": [
+ {
+ "expression": "workspace_rule_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "user_notification_workspace_project_projectId_idx": {
+ "name": "user_notification_workspace_project_projectId_idx",
+ "columns": [
+ {
+ "expression": "project_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "user_notification_workspace_project_workspaceId_projectId_idx": {
+ "name": "user_notification_workspace_project_workspaceId_projectId_idx",
+ "columns": [
+ {
+ "expression": "workspace_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "project_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "unwp_workspaceId_workspaceRuleId_idx": {
+ "name": "unwp_workspaceId_workspaceRuleId_idx",
+ "columns": [
+ {
+ "expression": "workspace_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "workspace_rule_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "user_notification_workspace_project_workspace_id_workspace_id_fk": {
+ "name": "user_notification_workspace_project_workspace_id_workspace_id_fk",
+ "tableFrom": "user_notification_workspace_project",
+ "tableTo": "workspace",
+ "columnsFrom": [
+ "workspace_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "cascade"
+ },
+ "user_notification_workspace_project_workspace_id_workspace_rule_id_user_notification_workspace_rule_workspace_id_id_fk": {
+ "name": "user_notification_workspace_project_workspace_id_workspace_rule_id_user_notification_workspace_rule_workspace_id_id_fk",
+ "tableFrom": "user_notification_workspace_project",
+ "tableTo": "user_notification_workspace_rule",
+ "columnsFrom": [
+ "workspace_id",
+ "workspace_rule_id"
+ ],
+ "columnsTo": [
+ "workspace_id",
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "cascade"
+ },
+ "user_notification_workspace_project_workspace_id_project_id_project_workspace_id_id_fk": {
+ "name": "user_notification_workspace_project_workspace_id_project_id_project_workspace_id_id_fk",
+ "tableFrom": "user_notification_workspace_project",
+ "tableTo": "project",
+ "columnsFrom": [
+ "workspace_id",
+ "project_id"
+ ],
+ "columnsTo": [
+ "workspace_id",
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "cascade"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "user_notification_workspace_project_rule_project_unique": {
+ "name": "user_notification_workspace_project_rule_project_unique",
+ "nullsNotDistinct": false,
+ "columns": [
+ "workspace_rule_id",
+ "project_id"
+ ]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.user_notification_workspace_rule": {
+ "name": "user_notification_workspace_rule",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "is_active": {
+ "name": "is_active",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": true
+ },
+ "email_enabled": {
+ "name": "email_enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "ntfy_enabled": {
+ "name": "ntfy_enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "gotify_enabled": {
+ "name": "gotify_enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "webhook_enabled": {
+ "name": "webhook_enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "project_mode": {
+ "name": "project_mode",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'all'"
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "(now() AT TIME ZONE 'utc')"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "(now() AT TIME ZONE 'utc')"
+ }
+ },
+ "indexes": {
+ "user_notification_workspace_rule_userId_idx": {
+ "name": "user_notification_workspace_rule_userId_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "user_notification_workspace_rule_workspaceId_idx": {
+ "name": "user_notification_workspace_rule_workspaceId_idx",
+ "columns": [
+ {
+ "expression": "workspace_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "user_notification_workspace_rule_user_id_user_id_fk": {
+ "name": "user_notification_workspace_rule_user_id_user_id_fk",
+ "tableFrom": "user_notification_workspace_rule",
+ "tableTo": "user",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "cascade"
+ },
+ "user_notification_workspace_rule_workspace_id_workspace_id_fk": {
+ "name": "user_notification_workspace_rule_workspace_id_workspace_id_fk",
+ "tableFrom": "user_notification_workspace_rule",
+ "tableTo": "workspace",
+ "columnsFrom": [
+ "workspace_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "cascade"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "user_notification_workspace_rule_user_workspace_unique": {
+ "name": "user_notification_workspace_rule_user_workspace_unique",
+ "nullsNotDistinct": false,
+ "columns": [
+ "user_id",
+ "workspace_id"
+ ]
+ },
+ "user_notification_workspace_rule_workspace_id_id_unique": {
+ "name": "user_notification_workspace_rule_workspace_id_id_unique",
+ "nullsNotDistinct": false,
+ "columns": [
+ "workspace_id",
+ "id"
+ ]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.verification": {
+ "name": "verification",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "identifier": {
+ "name": "identifier",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "value": {
+ "name": "value",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "(now() AT TIME ZONE 'utc')"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "(now() AT TIME ZONE 'utc')"
+ }
+ },
+ "indexes": {
+ "verification_identifier_idx": {
+ "name": "verification_identifier_idx",
+ "columns": [
+ {
+ "expression": "identifier",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.workflow_rule": {
+ "name": "workflow_rule",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "project_id": {
+ "name": "project_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "integration_type": {
+ "name": "integration_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "event_type": {
+ "name": "event_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "column_id": {
+ "name": "column_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "(now() AT TIME ZONE 'utc')"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "(now() AT TIME ZONE 'utc')"
+ }
+ },
+ "indexes": {
+ "workflow_rule_projectId_idx": {
+ "name": "workflow_rule_projectId_idx",
+ "columns": [
+ {
+ "expression": "project_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "workflow_rule_columnId_idx": {
+ "name": "workflow_rule_columnId_idx",
+ "columns": [
+ {
+ "expression": "column_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "workflow_rule_project_id_project_id_fk": {
+ "name": "workflow_rule_project_id_project_id_fk",
+ "tableFrom": "workflow_rule",
+ "tableTo": "project",
+ "columnsFrom": [
+ "project_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "cascade"
+ },
+ "workflow_rule_column_id_column_id_fk": {
+ "name": "workflow_rule_column_id_column_id_fk",
+ "tableFrom": "workflow_rule",
+ "tableTo": "column",
+ "columnsFrom": [
+ "column_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "cascade"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.workspace": {
+ "name": "workspace",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "slug": {
+ "name": "slug",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "logo": {
+ "name": "logo",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "metadata": {
+ "name": "metadata",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "description": {
+ "name": "description",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "workspace_slug_unique": {
+ "name": "workspace_slug_unique",
+ "nullsNotDistinct": false,
+ "columns": [
+ "slug"
+ ]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.workspace_billing": {
+ "name": "workspace_billing",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "founding_free": {
+ "name": "founding_free",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "trial_ends_at": {
+ "name": "trial_ends_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "creem_customer_id": {
+ "name": "creem_customer_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "creem_subscription_id": {
+ "name": "creem_subscription_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "creem_product_id": {
+ "name": "creem_product_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "plan": {
+ "name": "plan",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "billing_interval": {
+ "name": "billing_interval",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "status": {
+ "name": "status",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "seats": {
+ "name": "seats",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 1
+ },
+ "current_period_end": {
+ "name": "current_period_end",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "canceled_at": {
+ "name": "canceled_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "(now() AT TIME ZONE 'utc')"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "(now() AT TIME ZONE 'utc')"
+ }
+ },
+ "indexes": {
+ "workspace_billing_workspaceId_idx": {
+ "name": "workspace_billing_workspaceId_idx",
+ "columns": [
+ {
+ "expression": "workspace_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "workspace_billing_workspace_id_workspace_id_fk": {
+ "name": "workspace_billing_workspace_id_workspace_id_fk",
+ "tableFrom": "workspace_billing",
+ "tableTo": "workspace",
+ "columnsFrom": [
+ "workspace_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "cascade"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "workspace_billing_workspace_id_unique": {
+ "name": "workspace_billing_workspace_id_unique",
+ "nullsNotDistinct": false,
+ "columns": [
+ "workspace_id"
+ ]
+ },
+ "workspace_billing_creem_subscription_id_unique": {
+ "name": "workspace_billing_creem_subscription_id_unique",
+ "nullsNotDistinct": false,
+ "columns": [
+ "creem_subscription_id"
+ ]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.workspace_member_access": {
+ "name": "workspace_member_access",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "project_access": {
+ "name": "project_access",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'all'"
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "(now() AT TIME ZONE 'utc')"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "(now() AT TIME ZONE 'utc')"
+ }
+ },
+ "indexes": {
+ "workspace_member_access_userId_idx": {
+ "name": "workspace_member_access_userId_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "workspace_member_access_workspace_id_workspace_id_fk": {
+ "name": "workspace_member_access_workspace_id_workspace_id_fk",
+ "tableFrom": "workspace_member_access",
+ "tableTo": "workspace",
+ "columnsFrom": [
+ "workspace_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "workspace_member_access_user_id_user_id_fk": {
+ "name": "workspace_member_access_user_id_user_id_fk",
+ "tableFrom": "workspace_member_access",
+ "tableTo": "user",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "workspace_member_access_workspace_user_unique": {
+ "name": "workspace_member_access_workspace_user_unique",
+ "nullsNotDistinct": false,
+ "columns": [
+ "workspace_id",
+ "user_id"
+ ]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.workspace_member_project": {
+ "name": "workspace_member_project",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "project_id": {
+ "name": "project_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "(now() AT TIME ZONE 'utc')"
+ }
+ },
+ "indexes": {
+ "workspace_member_project_projectId_idx": {
+ "name": "workspace_member_project_projectId_idx",
+ "columns": [
+ {
+ "expression": "project_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "workspace_member_project_user_id_user_id_fk": {
+ "name": "workspace_member_project_user_id_user_id_fk",
+ "tableFrom": "workspace_member_project",
+ "tableTo": "user",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "workspace_member_project_workspace_id_project_id_project_workspace_id_id_fk": {
+ "name": "workspace_member_project_workspace_id_project_id_project_workspace_id_id_fk",
+ "tableFrom": "workspace_member_project",
+ "tableTo": "project",
+ "columnsFrom": [
+ "workspace_id",
+ "project_id"
+ ],
+ "columnsTo": [
+ "workspace_id",
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "cascade"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "workspace_member_project_workspace_user_project_unique": {
+ "name": "workspace_member_project_workspace_user_project_unique",
+ "nullsNotDistinct": false,
+ "columns": [
+ "workspace_id",
+ "user_id",
+ "project_id"
+ ]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.workspace_member": {
+ "name": "workspace_member",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "role": {
+ "name": "role",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'member'"
+ },
+ "joined_at": {
+ "name": "joined_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "workspace_member_workspaceId_idx": {
+ "name": "workspace_member_workspaceId_idx",
+ "columns": [
+ {
+ "expression": "workspace_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "workspace_member_userId_idx": {
+ "name": "workspace_member_userId_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "workspace_member_workspace_id_workspace_id_fk": {
+ "name": "workspace_member_workspace_id_workspace_id_fk",
+ "tableFrom": "workspace_member",
+ "tableTo": "workspace",
+ "columnsFrom": [
+ "workspace_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "workspace_member_user_id_user_id_fk": {
+ "name": "workspace_member_user_id_user_id_fk",
+ "tableFrom": "workspace_member",
+ "tableTo": "user",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ }
+ },
+ "enums": {},
+ "schemas": {},
+ "sequences": {},
+ "roles": {},
+ "policies": {},
+ "views": {},
+ "_meta": {
+ "columns": {},
+ "schemas": {},
+ "tables": {}
+ }
+}
\ No newline at end of file
diff --git a/apps/api/drizzle/meta/_journal.json b/apps/api/drizzle/meta/_journal.json
index b20531503..e0d80884f 100644
--- a/apps/api/drizzle/meta/_journal.json
+++ b/apps/api/drizzle/meta/_journal.json
@@ -449,6 +449,13 @@
"when": 1791727180448,
"tag": "0063_import_runs",
"breakpoints": true
+ },
+ {
+ "idx": 64,
+ "version": "7",
+ "when": 1792228916894,
+ "tag": "0064_custom_field_hidden_options",
+ "breakpoints": true
}
]
}
\ No newline at end of file
diff --git a/apps/api/src/custom-field/assert-valid-definition.ts b/apps/api/src/custom-field/assert-valid-definition.ts
index b5ce324f8..833d9a988 100644
--- a/apps/api/src/custom-field/assert-valid-definition.ts
+++ b/apps/api/src/custom-field/assert-valid-definition.ts
@@ -1,4 +1,5 @@
import { HTTPException } from "hono/http-exception";
+import { isChoiceType, parseChoiceValue } from "./choice-options";
import {
isCustomFieldValueEmpty,
validateCustomFieldValue,
@@ -12,6 +13,7 @@ type CustomFieldDefinitionInput = {
required: boolean;
defaultValue?: string | null;
options?: string[] | null;
+ hiddenOptions?: string[];
};
function badRequest(message: string): never {
@@ -57,6 +59,28 @@ function assertValidDefaultForType(
}
}
+function assertValidHiddenOptions({
+ type,
+ defaultValue,
+ options,
+ hiddenOptions = [],
+}: CustomFieldDefinitionInput) {
+ if (hiddenOptions.length === 0) return;
+ if (!isChoiceType(type)) {
+ badRequest("Only dropdown and multiselect fields have options");
+ }
+
+ const known = new Set((options ?? []).map((option) => option.trim()));
+ if (hiddenOptions.some((option) => !known.has(option))) {
+ badRequest("Hidden options must be options of this field");
+ }
+
+ const picked = parseChoiceValue(defaultValue ?? null, type);
+ if (picked.some((option) => hiddenOptions.includes(option))) {
+ badRequest("The default can't be a hidden option");
+ }
+}
+
export function assertValidDefinition(input: CustomFieldDefinitionInput) {
const { name, type, required, defaultValue, options } = input;
@@ -97,4 +121,6 @@ export function assertValidDefinition(input: CustomFieldDefinitionInput) {
if (error) badRequest(error);
}
}
+
+ assertValidHiddenOptions(input);
}
diff --git a/apps/api/src/custom-field/choice-options.ts b/apps/api/src/custom-field/choice-options.ts
index e050a0760..a5c326853 100644
--- a/apps/api/src/custom-field/choice-options.ts
+++ b/apps/api/src/custom-field/choice-options.ts
@@ -61,3 +61,23 @@ export function findUsedOptions(
);
return candidates.filter((option) => used.has(option));
}
+
+// Hidden options are a subset of the field's options; stale entries drop out.
+export function readHiddenOptions(hidden: unknown, options: string[]) {
+ return readOptions(hidden).filter((option) => options.includes(option));
+}
+
+// Hidden options stay on tasks that already have them but can't be picked
+// anew, so only options missing from the current value count.
+export function findNewHiddenPicks(
+ next: string | null,
+ current: string | null,
+ type: ChoiceType,
+ hidden: string[],
+): string[] {
+ if (hidden.length === 0) return [];
+ const kept = new Set(parseChoiceValue(current, type));
+ return parseChoiceValue(next, type).filter(
+ (option) => hidden.includes(option) && !kept.has(option),
+ );
+}
diff --git a/apps/api/src/custom-field/controllers/set-custom-field-value.ts b/apps/api/src/custom-field/controllers/set-custom-field-value.ts
index 99349655a..9c94edef0 100644
--- a/apps/api/src/custom-field/controllers/set-custom-field-value.ts
+++ b/apps/api/src/custom-field/controllers/set-custom-field-value.ts
@@ -1,4 +1,4 @@
-import { eq, sql } from "drizzle-orm";
+import { and, eq, sql } from "drizzle-orm";
import { HTTPException } from "hono/http-exception";
import db from "../../database";
@@ -7,6 +7,12 @@ import {
customFieldValueTable,
taskTable,
} from "../../database/schema";
+import {
+ findNewHiddenPicks,
+ isChoiceType,
+ readHiddenOptions,
+ readOptions,
+} from "../choice-options";
function isMultiselectEmpty(value: string): boolean {
if (!value || value.trim().length === 0) return true;
@@ -124,6 +130,35 @@ async function setCustomFieldValue(
}
}
+ const hidden = readHiddenOptions(
+ field.hiddenOptions,
+ readOptions(field.options),
+ );
+ if (isChoiceType(field.type) && hidden.length > 0) {
+ const [current] = await db
+ .select({ value: customFieldValueTable.value })
+ .from(customFieldValueTable)
+ .where(
+ and(
+ eq(customFieldValueTable.taskId, taskId),
+ eq(customFieldValueTable.fieldId, fieldId),
+ ),
+ )
+ .limit(1);
+ if (
+ findNewHiddenPicks(
+ normalizedValue,
+ current?.value ?? null,
+ field.type,
+ hidden,
+ ).length > 0
+ ) {
+ throw new HTTPException(400, {
+ message: "Hidden options can't be selected",
+ });
+ }
+ }
+
const [result] = await db
.insert(customFieldValueTable)
.values({
diff --git a/apps/api/src/custom-field/controllers/update-custom-field.ts b/apps/api/src/custom-field/controllers/update-custom-field.ts
index e71afa59a..d58df521b 100644
--- a/apps/api/src/custom-field/controllers/update-custom-field.ts
+++ b/apps/api/src/custom-field/controllers/update-custom-field.ts
@@ -73,6 +73,7 @@ async function updateCustomField(id: string, input: CustomFieldUpdateInput) {
required: next.required,
defaultValue: next.defaultValue,
options: next.options,
+ hiddenOptions: next.hiddenOptions,
})
.where(eq(customFieldDefinitionTable.id, id))
.returning();
diff --git a/apps/api/src/custom-field/plan-choice-value-changes.ts b/apps/api/src/custom-field/plan-choice-value-changes.ts
index d7930d453..21a37b0f0 100644
--- a/apps/api/src/custom-field/plan-choice-value-changes.ts
+++ b/apps/api/src/custom-field/plan-choice-value-changes.ts
@@ -30,7 +30,7 @@ export function planChoiceValueChanges({
const used = findUsedOptions(values, from, removedOptions);
if (used.length > 0) {
throw new HTTPException(400, {
- message: `Can't remove ${quote(used)} because tasks still use ${used.length === 1 ? "it" : "them"}. Pick a different option on those tasks first.`,
+ message: `Can't remove ${quote(used)} because tasks still use ${used.length === 1 ? "it" : "them"}. Pick a different option on those tasks first, or hide it instead.`,
});
}
diff --git a/apps/api/src/custom-field/resolve-field-update.ts b/apps/api/src/custom-field/resolve-field-update.ts
index 6ec25879b..6b32990b9 100644
--- a/apps/api/src/custom-field/resolve-field-update.ts
+++ b/apps/api/src/custom-field/resolve-field-update.ts
@@ -4,6 +4,7 @@ import {
convertChoiceValue,
isChoiceType,
normalizeOptions,
+ readHiddenOptions,
readOptions,
} from "./choice-options";
@@ -13,6 +14,7 @@ export type CurrentCustomField = {
required: boolean;
defaultValue: string | null;
options: unknown;
+ hiddenOptions: unknown;
};
export type CustomFieldUpdateInput = {
@@ -21,6 +23,7 @@ export type CustomFieldUpdateInput = {
required?: boolean;
defaultValue?: string | null;
options?: string[];
+ hiddenOptions?: string[];
};
export type ResolvedFieldUpdate = {
@@ -29,6 +32,7 @@ export type ResolvedFieldUpdate = {
required: boolean;
defaultValue: string | null;
options: unknown;
+ hiddenOptions: string[];
removedOptions: string[];
};
@@ -83,7 +87,10 @@ export function resolveFieldUpdate(
const name = input.name === undefined ? field.name : input.name.trim();
if (!name) badRequest("Name cannot be empty");
- if (input.options !== undefined && !isChoiceType(type)) {
+ if (
+ (input.options !== undefined || input.hiddenOptions !== undefined) &&
+ !isChoiceType(type)
+ ) {
badRequest("Only dropdown and multiselect fields have options");
}
@@ -94,10 +101,24 @@ export function resolveFieldUpdate(
: normalizeOptions(input.options)
: null;
+ // Without new hidden options, keep the old ones that are still options.
+ const hiddenOptions = !options
+ ? []
+ : input.hiddenOptions === undefined
+ ? readHiddenOptions(field.hiddenOptions, options)
+ : normalizeOptions(input.hiddenOptions);
+
const required = input.required ?? field.required;
const defaultValue = resolveDefault(field, type, input.defaultValue);
- assertValidDefinition({ name, type, required, defaultValue, options });
+ assertValidDefinition({
+ name,
+ type,
+ required,
+ defaultValue,
+ options,
+ hiddenOptions,
+ });
return {
name,
@@ -105,6 +126,7 @@ export function resolveFieldUpdate(
required,
defaultValue,
options: options ?? field.options,
+ hiddenOptions,
removedOptions: options
? previousOptions.filter((option) => !options.includes(option))
: [],
diff --git a/apps/api/src/custom-field/response.ts b/apps/api/src/custom-field/response.ts
index 468078480..f4c9806ac 100644
--- a/apps/api/src/custom-field/response.ts
+++ b/apps/api/src/custom-field/response.ts
@@ -9,6 +9,10 @@ export const customFieldDefinitionSchema = z
required: z.boolean(),
defaultValue: z.string().nullable(),
options: z.unknown().nullable(),
+ hiddenOptions: z.array(z.string()).openapi({
+ description:
+ "Options no longer offered for new selections. Tasks that already use them keep them.",
+ }),
position: z.number(),
createdAt: responseTimestamp,
updatedAt: responseTimestamp,
diff --git a/apps/api/src/custom-field/schema.ts b/apps/api/src/custom-field/schema.ts
index 43d54cd44..f8dbc3234 100644
--- a/apps/api/src/custom-field/schema.ts
+++ b/apps/api/src/custom-field/schema.ts
@@ -50,6 +50,10 @@ export const updateCustomFieldBody = z.object({
description:
"The full option list for dropdown and multiselect fields, in display order. Adding and reordering options is always allowed. Removing or renaming an option that a task still uses is rejected with 400, so task values are never changed silently.",
}),
+ hiddenOptions: z.array(z.string()).optional().openapi({
+ description:
+ "Options to retire without removing them: tasks keep their existing selections, but hidden options can't be picked anew or used as the default. Must be a subset of `options`. Omit to keep the current hidden options that are still options.",
+ }),
});
export const reorderCustomFieldsBody = z.object({
diff --git a/apps/api/src/database/schema.ts b/apps/api/src/database/schema.ts
index d905f0951..38f023159 100644
--- a/apps/api/src/database/schema.ts
+++ b/apps/api/src/database/schema.ts
@@ -1430,6 +1430,11 @@ export const customFieldDefinitionTable = pgTable(
required: boolean("required").default(false).notNull(),
defaultValue: text("default_value"),
options: jsonb("options"),
+ // Options kept for tasks that already use them but no longer offered.
+ hiddenOptions: jsonb("hidden_options")
+ .$type<string[]>()
+ .default([])
+ .notNull(),
position: integer("position").default(0).notNull(),
createdAt: timestamp("created_at", { mode: "date" })
.default(utcNow)
diff --git a/apps/api/src/task/controllers/create-task.ts b/apps/api/src/task/controllers/create-task.ts
index e382cf3f9..c89f11500 100644
--- a/apps/api/src/task/controllers/create-task.ts
+++ b/apps/api/src/task/controllers/create-task.ts
@@ -11,6 +11,12 @@ import {
projectTable,
userTable,
} from "../../database/schema";
+import {
+ findNewHiddenPicks,
+ isChoiceType,
+ readHiddenOptions,
+ readOptions,
+} from "../../custom-field/choice-options";
import { publishEvent } from "../../events";
import {
assertAssignableUser,
@@ -83,6 +89,20 @@ async function createTask({
.from(customFieldDefinitionTable)
.where(eq(customFieldDefinitionTable.projectId, projectId));
+ for (const input of normalizedCustomFields ?? []) {
+ const field = allFields.find((candidate) => candidate.id === input.fieldId);
+ if (!field || !isChoiceType(field.type)) continue;
+ const hidden = readHiddenOptions(
+ field.hiddenOptions,
+ readOptions(field.options),
+ );
+ if (findNewHiddenPicks(input.value, null, field.type, hidden).length > 0) {
+ throw new HTTPException(400, {
+ message: `Custom field "${field.name}" has a hidden option selected.`,
+ });
+ }
+ }
+
const mergedCustomFields: CustomFieldInput[] = normalizedCustomFields ?? [];
const providedFieldIds = new Set(mergedCustomFields.map((f) => f.fieldId));
diff --git a/apps/docs/core/functional/configure-workflows.mdx b/apps/docs/core/functional/configure-workflows.mdx
index 1e7b04a2f..37466ad81 100644
--- a/apps/docs/core/functional/configure-workflows.mdx
+++ b/apps/docs/core/functional/configure-workflows.mdx
@@ -26,6 +26,8 @@ Drag fields to change their order. Task details list them in that order under **
To change a field, open its menu and select **Edit**. You can rename it, change its default, make it required, and add or reorder options. The type cannot change after a field is created, except switching a dropdown between one and several options. Kaneo refuses to remove or rename an option that tasks still use, and to turn off **Allow several** while a task has more than one option selected, so existing values never change silently.
+To retire an option that tasks still use, select the eye beside it while editing the field. A hidden option stays on the tasks that already have it, but it is no longer offered when picking a value, and it cannot be the default. Tasks can still remove it. Select the eye again to offer it once more.
+
Deleting a field removes it and its value from every task.
## Move tasks automatically
diff --git a/apps/docs/openapi.json b/apps/docs/openapi.json
index 45c88f56d..bf089e1d5 100644
--- a/apps/docs/openapi.json
+++ b/apps/docs/openapi.json
@@ -4576,6 +4576,13 @@
]
},
"options": {},
+ "hiddenOptions": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ },
+ "description": "Options no longer offered for new selections. Tasks that already use them keep them."
+ },
"position": {
"type": "number"
},
@@ -4595,6 +4602,7 @@
"type",
"required",
"defaultValue",
+ "hiddenOptions",
"position",
"createdAt",
"updatedAt"
@@ -22932,6 +22940,13 @@
"type": "string"
},
"description": "The full option list for dropdown and multiselect fields, in display order. Adding and reordering options is always allowed. Removing or renaming an option that a task still uses is rejected with 400, so task values are never changed silently."
+ },
+ "hiddenOptions": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ },
+ "description": "Options to retire without removing them: tasks keep their existing selections, but hidden options can't be picked anew or used as the default. Must be a subset of `options`. Omit to keep the current hidden options that are still options."
}
}
}
diff --git a/apps/web/src/components/custom-fields/custom-field-chip.test.tsx b/apps/web/src/components/custom-fields/custom-field-chip.test.tsx
index 49119e6b9..97bd9d2c1 100644
--- a/apps/web/src/components/custom-fields/custom-field-chip.test.tsx
+++ b/apps/web/src/components/custom-fields/custom-field-chip.test.tsx
@@ -23,6 +23,7 @@ const field = (
required: false,
defaultValue: null,
options: null,
+ hiddenOptions: [],
position: 0,
createdAt: "",
updatedAt: "",
diff --git a/apps/web/src/components/custom-fields/missing-required-fields.test.ts b/apps/web/src/components/custom-fields/missing-required-fields.test.ts
index a3dac631b..90e706a83 100644
--- a/apps/web/src/components/custom-fields/missing-required-fields.test.ts
+++ b/apps/web/src/components/custom-fields/missing-required-fields.test.ts
@@ -17,6 +17,7 @@ const field = (
required,
defaultValue: null,
options: null,
+ hiddenOptions: [],
position: 0,
createdAt: "",
updatedAt: "",
diff --git a/apps/web/src/components/custom-fields/option-field-editor.test.tsx b/apps/web/src/components/custom-fields/option-field-editor.test.tsx
new file mode 100644
index 000000000..13b419f0c
--- /dev/null
+++ b/apps/web/src/components/custom-fields/option-field-editor.test.tsx
@@ -0,0 +1,54 @@
+import { cleanup, render, screen } from "@testing-library/react";
+import { afterEach, describe, expect, it, vi } from "vite-plus/test";
+import type { CustomFieldDefinition } from "@/components/project/custom-fields/types";
+import { OptionFieldEditor } from "./option-field-editor";
+
+vi.mock("react-i18next", () => ({
+ useTranslation: () => ({ t: (key: string) => key }),
+}));
+
+afterEach(cleanup);
+
+const field: CustomFieldDefinition = {
+ id: "field-1",
+ projectId: "project-1",
+ name: "Platform",
+ type: "multiselect",
+ required: false,
+ defaultValue: null,
+ options: ["Web", "iOS", "Windows Phone"],
+ hiddenOptions: ["Windows Phone"],
+ position: 0,
+ createdAt: "",
+ updatedAt: "",
+};
+
+function renderEditor(selected: string[]) {
+ render(
+ <OptionFieldEditor
+ field={field}
+ selected={selected}
+ onToggle={vi.fn()}
+ onClear={vi.fn()}
+ />,
+ );
+}
+
+describe("OptionFieldEditor", () => {
+ it("leaves hidden options out of new selections", () => {
+ renderEditor([]);
+
+ expect(screen.getByRole("option", { name: "Web" })).toBeInTheDocument();
+ expect(
+ screen.queryByRole("option", { name: "Windows Phone" }),
+ ).not.toBeInTheDocument();
+ });
+
+ it("keeps a hidden option the task already has so it can be removed", () => {
+ renderEditor(["Windows Phone"]);
+
+ expect(
+ screen.getByRole("option", { name: "Windows Phone" }),
+ ).toBeInTheDocument();
+ });
+});
diff --git a/apps/web/src/components/custom-fields/option-field-editor.tsx b/apps/web/src/components/custom-fields/option-field-editor.tsx
index e8121703e..354d20f47 100644
--- a/apps/web/src/components/custom-fields/option-field-editor.tsx
+++ b/apps/web/src/components/custom-fields/option-field-editor.tsx
@@ -22,7 +22,11 @@ export function OptionFieldEditor({
const { t } = useTranslation();
const [query, setQuery] = useState("");
const multiple = field.type === "multiselect";
- const options = Array.from(new Set(field.options ?? []));
+ // Hidden options stay listed only while selected, so they can be removed.
+ const options = Array.from(new Set(field.options ?? [])).filter(
+ (option) =>
+ !field.hiddenOptions?.includes(option) || selected.includes(option),
+ );
const needle = query.trim().toLowerCase();
const filtered = options.filter((option) =>
option.toLowerCase().includes(needle),
diff --git a/apps/web/src/components/project/custom-fields/custom-field-list.test.tsx b/apps/web/src/components/project/custom-fields/custom-field-list.test.tsx
index 5babd21b3..ab6754580 100644
--- a/apps/web/src/components/project/custom-fields/custom-field-list.test.tsx
+++ b/apps/web/src/components/project/custom-fields/custom-field-list.test.tsx
@@ -52,6 +52,7 @@ const size: CustomFieldDefinition = {
required: true,
defaultValue: "Medium",
options: ["Small", "Medium", "Large"],
+ hiddenOptions: [],
position: 0,
createdAt: "",
updatedAt: "",
diff --git a/apps/web/src/components/project/custom-fields/field-dialog/custom-field-dialog.test.tsx b/apps/web/src/components/project/custom-fields/field-dialog/custom-field-dialog.test.tsx
index 93fa9811f..a890fca36 100644
--- a/apps/web/src/components/project/custom-fields/field-dialog/custom-field-dialog.test.tsx
+++ b/apps/web/src/components/project/custom-fields/field-dialog/custom-field-dialog.test.tsx
@@ -49,6 +49,7 @@ const platforms: CustomFieldDefinition = {
required: false,
defaultValue: '["Web"]',
options: ["iOS", "Web"],
+ hiddenOptions: [],
position: 0,
createdAt: "",
updatedAt: "",
@@ -203,12 +204,62 @@ describe("CustomFieldDialog", () => {
required: false,
defaultValue: null,
options: ["iOS", "Android"],
+ hiddenOptions: [],
},
}),
);
expect(m.createField).not.toHaveBeenCalled();
});
+ it("hides an option when editing and drops it from the default", async () => {
+ const { dialog } = renderDialog(platforms);
+ const hide = within(dialog).getAllByRole("button", {
+ name: "settings:customFields.hideOptionAria",
+ })[1];
+ expect(hide).toHaveAttribute("aria-pressed", "false");
+ fireEvent.click(hide);
+ expect(
+ within(dialog).getAllByRole("button", {
+ name: "settings:customFields.showOptionAria",
+ }),
+ ).toHaveLength(1);
+
+ fireEvent.click(
+ within(dialog).getByRole("button", {
+ name: "settings:customFields.save",
+ }),
+ );
+ await waitFor(() =>
+ expect(m.updateField).toHaveBeenCalledWith({
+ id: "f1",
+ data: expect.objectContaining({
+ defaultValue: null,
+ options: ["iOS", "Web"],
+ hiddenOptions: ["Web"],
+ }),
+ }),
+ );
+ });
+
+ it("offers no hide control while creating a field", () => {
+ const { dialog } = renderDialog();
+ fireEvent.click(
+ within(dialog).getByRole("radio", {
+ name: "settings:customFields.types.dropdown",
+ }),
+ );
+ const addOption = within(dialog).getByRole("textbox", {
+ name: "settings:customFields.addOption",
+ });
+ fireEvent.change(addOption, { target: { value: "Small" } });
+ fireEvent.keyDown(addOption, { key: "Enter" });
+ expect(
+ within(dialog).queryByRole("button", {
+ name: "settings:customFields.hideOptionAria",
+ }),
+ ).not.toBeInTheDocument();
+ });
+
it("keeps the dialog open and shows the API error", async () => {
m.updateField.mockRejectedValue(
new Error('Can\'t remove "Web" because tasks still use it.'),
diff --git a/apps/web/src/components/project/custom-fields/field-dialog/custom-field-dialog.tsx b/apps/web/src/components/project/custom-fields/field-dialog/custom-field-dialog.tsx
index cf998de22..79469f619 100644
--- a/apps/web/src/components/project/custom-fields/field-dialog/custom-field-dialog.tsx
+++ b/apps/web/src/components/project/custom-fields/field-dialog/custom-field-dialog.tsx
@@ -11,6 +11,7 @@ import {
setKind,
setMultiple,
toCreatePayload,
+ toggleOptionHidden,
toUpdatePayload,
} from "@/components/project/custom-fields/field-dialog/field-form";
import { FieldOptionsEditor } from "@/components/project/custom-fields/field-dialog/field-options-editor";
@@ -170,6 +171,7 @@ export function CustomFieldDialog({
</p>
<FieldOptionsEditor
options={form.options}
+ hiddenOptions={form.hiddenOptions}
labelledBy={optionsLabelId}
onAdd={(option) =>
setForm((current) => addOption(current, option))
@@ -181,6 +183,14 @@ export function CustomFieldDialog({
onMove={(from, to) =>
setForm((current) => moveOption(current, from, to))
}
+ onToggleHidden={
+ field
+ ? (option) =>
+ setForm((current) =>
+ toggleOptionHidden(current, option),
+ )
+ : undefined
+ }
/>
</div>
) : null}
diff --git a/apps/web/src/components/project/custom-fields/field-dialog/field-default-input.tsx b/apps/web/src/components/project/custom-fields/field-dialog/field-default-input.tsx
index 85c4960f9..2936ad939 100644
--- a/apps/web/src/components/project/custom-fields/field-dialog/field-default-input.tsx
+++ b/apps/web/src/components/project/custom-fields/field-dialog/field-default-input.tsx
@@ -2,7 +2,10 @@ import { useTranslation } from "react-i18next";
import { CheckboxDefaultSelect } from "@/components/project/custom-fields/field-dialog/checkbox-default-select";
import { ChoiceDefaultSelect } from "@/components/project/custom-fields/field-dialog/choice-default-select";
import { DateDefaultPicker } from "@/components/project/custom-fields/field-dialog/date-default-picker";
-import type { FieldFormState } from "@/components/project/custom-fields/field-dialog/field-form";
+import {
+ type FieldFormState,
+ visibleOptions,
+} from "@/components/project/custom-fields/field-dialog/field-form";
import { MultiChoiceDefaultSelect } from "@/components/project/custom-fields/field-dialog/multi-choice-default-select";
import { Input } from "@/components/ui/input";
@@ -44,7 +47,7 @@ export function FieldDefaultInput({
case "dropdown":
return form.multiple ? (
<MultiChoiceDefaultSelect
- options={form.options}
+ options={visibleOptions(form)}
value={form.defaultValues}
labelledBy={labelledBy}
onChange={(defaultValues) =>
@@ -53,7 +56,7 @@ export function FieldDefaultInput({
/>
) : (
<ChoiceDefaultSelect
- options={form.options}
+ options={visibleOptions(form)}
value={form.defaultValue}
labelledBy={labelledBy}
clearable={!form.required}
diff --git a/apps/web/src/components/project/custom-fields/field-dialog/field-form.test.ts b/apps/web/src/components/project/custom-fields/field-dialog/field-form.test.ts
index 987ced1b8..5cbdd291b 100644
--- a/apps/web/src/components/project/custom-fields/field-dialog/field-form.test.ts
+++ b/apps/web/src/components/project/custom-fields/field-dialog/field-form.test.ts
@@ -11,7 +11,9 @@ import {
setKind,
setMultiple,
toCreatePayload,
+ toggleOptionHidden,
toUpdatePayload,
+ visibleOptions,
} from "@/components/project/custom-fields/field-dialog/field-form";
import type { CustomFieldDefinition } from "@/components/project/custom-fields/types";
@@ -34,6 +36,7 @@ function definition(
required: false,
defaultValue: null,
options: null,
+ hiddenOptions: [],
position: 0,
createdAt: "",
updatedAt: "",
@@ -192,3 +195,35 @@ describe("payloads", () => {
});
});
});
+
+describe("hidden options", () => {
+ it("hides an option and clears it from the defaults", () => {
+ const hidden = toggleOptionHidden(
+ { ...dropdown, defaultValues: ["Medium", "Large"] },
+ "Medium",
+ );
+ expect(hidden.hiddenOptions).toEqual(["Medium"]);
+ expect(hidden.defaultValue).toBe("");
+ expect(hidden.defaultValues).toEqual(["Large"]);
+ expect(visibleOptions(hidden)).toEqual(["Small", "Large"]);
+
+ const shown = toggleOptionHidden(hidden, "Medium");
+ expect(shown.hiddenOptions).toEqual([]);
+ expect(visibleOptions(shown)).toEqual(["Small", "Medium", "Large"]);
+ });
+
+ it("keeps hidden options in step with renames and removals", () => {
+ const hidden = toggleOptionHidden(dropdown, "Large");
+ expect(renameOption(hidden, "Large", "XL").hiddenOptions).toEqual(["XL"]);
+ expect(removeOption(hidden, "Large").hiddenOptions).toEqual([]);
+ });
+
+ it("sends hidden options with dropdown updates", () => {
+ expect(
+ toUpdatePayload(toggleOptionHidden(dropdown, "Small")),
+ ).toMatchObject({
+ options: ["Small", "Medium", "Large"],
+ hiddenOptions: ["Small"],
+ });
+ });
+});
diff --git a/apps/web/src/components/project/custom-fields/field-dialog/field-form.ts b/apps/web/src/components/project/custom-fields/field-dialog/field-form.ts
index a262c3924..8f3c27365 100644
--- a/apps/web/src/components/project/custom-fields/field-dialog/field-form.ts
+++ b/apps/web/src/components/project/custom-fields/field-dialog/field-form.ts
@@ -10,6 +10,7 @@ export type FieldFormState = {
kind: FieldKind;
name: string;
options: string[];
+ hiddenOptions: string[];
multiple: boolean;
required: boolean;
defaultValue: string;
@@ -26,6 +27,7 @@ export const EMPTY_FIELD_FORM: FieldFormState = {
kind: "text",
name: "",
options: [],
+ hiddenOptions: [],
multiple: false,
required: false,
defaultValue: "",
@@ -60,6 +62,7 @@ export function formFromField(field?: CustomFieldDefinition | null) {
kind: toFieldKind(field.type),
name: field.name,
options: field.options ?? [],
+ hiddenOptions: field.hiddenOptions ?? [],
multiple,
required: field.required,
defaultValue: initialDefault(field),
@@ -105,6 +108,9 @@ export function removeOption(state: FieldFormState, option: string) {
return {
...state,
options: state.options.filter((candidate) => candidate !== option),
+ hiddenOptions: state.hiddenOptions.filter(
+ (candidate) => candidate !== option,
+ ),
defaultValue: state.defaultValue === option ? "" : state.defaultValue,
defaultValues: state.defaultValues.filter((value) => value !== option),
};
@@ -118,11 +124,36 @@ export function renameOption(state: FieldFormState, from: string, raw: string) {
return {
...state,
options: state.options.map(rename),
+ hiddenOptions: state.hiddenOptions.map(rename),
defaultValue: rename(state.defaultValue),
defaultValues: state.defaultValues.map(rename),
};
}
+// A hidden option can't be the default, so hiding one also clears it there.
+export function toggleOptionHidden(state: FieldFormState, option: string) {
+ if (state.hiddenOptions.includes(option)) {
+ return {
+ ...state,
+ hiddenOptions: state.hiddenOptions.filter(
+ (candidate) => candidate !== option,
+ ),
+ };
+ }
+ return {
+ ...state,
+ hiddenOptions: [...state.hiddenOptions, option],
+ defaultValue: state.defaultValue === option ? "" : state.defaultValue,
+ defaultValues: state.defaultValues.filter((value) => value !== option),
+ };
+}
+
+export function visibleOptions(state: FieldFormState) {
+ return state.options.filter(
+ (option) => !state.hiddenOptions.includes(option),
+ );
+}
+
export function moveOption(state: FieldFormState, from: number, to: number) {
return { ...state, options: moveItem(state.options, from, to) };
}
@@ -174,6 +205,8 @@ export function toUpdatePayload(state: FieldFormState) {
type: toApiType(state),
required: state.required,
defaultValue: toApiDefault(state),
- ...(state.kind === "dropdown" ? { options: state.options } : {}),
+ ...(state.kind === "dropdown"
+ ? { options: state.options, hiddenOptions: state.hiddenOptions }
+ : {}),
};
}
diff --git a/apps/web/src/components/project/custom-fields/field-dialog/field-option-row.tsx b/apps/web/src/components/project/custom-fields/field-dialog/field-option-row.tsx
index 041ca198c..296eec9fb 100644
--- a/apps/web/src/components/project/custom-fields/field-dialog/field-option-row.tsx
+++ b/apps/web/src/components/project/custom-fields/field-dialog/field-option-row.tsx
@@ -1,4 +1,4 @@
-import { X } from "lucide-react";
+import { Eye, EyeOff, X } from "lucide-react";
import { useTranslation } from "react-i18next";
import { InlineNameInput } from "@/components/project/inline-name-input";
import { DragHandle } from "@/components/project/sortable/drag-handle";
@@ -8,14 +8,19 @@ import { cn } from "@/lib/cn";
type FieldOptionRowProps = {
option: string;
+ hidden: boolean;
onRename: (name: string) => boolean;
onRemove: () => void;
+ /** Hiding retires an option; only offered for fields that already exist. */
+ onToggleHidden?: () => void;
};
export function FieldOptionRow({
option,
+ hidden,
onRename,
onRemove,
+ onToggleHidden,
}: FieldOptionRowProps) {
const { t } = useTranslation();
const { rowRef, rowStyle, isDragging, handleProps } = useSortableRow(
@@ -40,8 +45,26 @@ export function FieldOptionRow({
name={option}
label={t("settings:customFields.renameOptionAria", { option })}
onRename={onRename}
- className="h-7"
+ className={cn("h-7", hidden && "text-muted-foreground")}
/>
+ {onToggleHidden ? (
+ <Button
+ type="button"
+ variant="ghost"
+ size="icon-xs"
+ aria-label={t(
+ hidden
+ ? "settings:customFields.showOptionAria"
+ : "settings:customFields.hideOptionAria",
+ { option },
+ )}
+ aria-pressed={hidden}
+ onClick={onToggleHidden}
+ className="text-muted-foreground"
+ >
+ {hidden ? <EyeOff aria-hidden="true" /> : <Eye aria-hidden="true" />}
+ </Button>
+ ) : null}
<Button
type="button"
variant="ghost"
diff --git a/apps/web/src/components/project/custom-fields/field-dialog/field-options-editor.tsx b/apps/web/src/components/project/custom-fields/field-dialog/field-options-editor.tsx
index 1ac8f641f..a7756733f 100644
--- a/apps/web/src/components/project/custom-fields/field-dialog/field-options-editor.tsx
+++ b/apps/web/src/components/project/custom-fields/field-dialog/field-options-editor.tsx
@@ -4,20 +4,24 @@ import { SortableList } from "@/components/project/sortable/sortable-list";
type FieldOptionsEditorProps = {
options: string[];
+ hiddenOptions: string[];
labelledBy: string;
onAdd: (option: string) => void;
onRename: (from: string, to: string) => boolean;
onRemove: (option: string) => void;
onMove: (from: number, to: number) => void;
+ onToggleHidden?: (option: string) => void;
};
export function FieldOptionsEditor({
options,
+ hiddenOptions,
labelledBy,
onAdd,
onRename,
onRemove,
onMove,
+ onToggleHidden,
}: FieldOptionsEditorProps) {
return (
<div
@@ -30,8 +34,12 @@ export function FieldOptionsEditor({
<FieldOptionRow
key={option}
option={option}
+ hidden={hiddenOptions.includes(option)}
onRename={(to) => onRename(option, to)}
onRemove={() => onRemove(option)}
+ onToggleHidden={
+ onToggleHidden ? () => onToggleHidden(option) : undefined
+ }
/>
))}
</SortableList>
diff --git a/apps/web/src/components/project/custom-fields/types.ts b/apps/web/src/components/project/custom-fields/types.ts
index ca14e85d2..0c9b72aa4 100644
--- a/apps/web/src/components/project/custom-fields/types.ts
+++ b/apps/web/src/components/project/custom-fields/types.ts
@@ -14,6 +14,7 @@ export type CustomFieldDefinition = {
required: boolean;
defaultValue: string | null;
options: string[] | null;
+ hiddenOptions: string[];
position: number;
createdAt: string;
updatedAt: string;
diff --git a/i18n/az-AZ.json b/i18n/az-AZ.json
index d60fde309..279bd2b75 100644
--- a/i18n/az-AZ.json
+++ b/i18n/az-AZ.json
@@ -1563,6 +1563,8 @@
"noDefault": "Standart dəyər yoxdur",
"optionsLabel": "Seçimlər",
"removeOptionAria": "{{option}} seçimini çıxar",
+ "hideOptionAria": "{{option}} seçimini yeni seçimlərdən gizlət",
+ "showOptionAria": "{{option}} seçimini yeni seçimlər üçün yenidən göstər",
"renameOptionAria": "{{option}} seçiminin adını dəyiş",
"requiredDescription": "Hər tapşırığın həmişə dəyəri olur.",
"save": "Yadda saxla",
diff --git a/i18n/de-DE.json b/i18n/de-DE.json
index ff4ac32ac..bd4ffaae6 100644
--- a/i18n/de-DE.json
+++ b/i18n/de-DE.json
@@ -1640,6 +1640,8 @@
"noDefault": "Kein Standardwert",
"optionsLabel": "Optionen",
"removeOptionAria": "{{option}} entfernen",
+ "hideOptionAria": "{{option}} für neue Auswahlen ausblenden",
+ "showOptionAria": "{{option}} wieder für neue Auswahlen anbieten",
"renameOptionAria": "{{option}} umbenennen",
"requiredDescription": "Jede Aufgabe hat immer einen Wert.",
"save": "Speichern",
diff --git a/i18n/el-GR.json b/i18n/el-GR.json
index 4d21e668d..4737652b2 100644
--- a/i18n/el-GR.json
+++ b/i18n/el-GR.json
@@ -1563,6 +1563,8 @@
"noDefault": "Χωρίς προεπιλογή",
"optionsLabel": "Επιλογές",
"removeOptionAria": "Αφαίρεση {{option}}",
+ "hideOptionAria": "Απόκρυψη {{option}} από νέες επιλογές",
+ "showOptionAria": "Επαναφορά {{option}} για νέες επιλογές",
"renameOptionAria": "Μετονομασία {{option}}",
"requiredDescription": "Κάθε εργασία έχει πάντα τιμή.",
"save": "Αποθήκευση",
diff --git a/i18n/en-US.json b/i18n/en-US.json
index e7c6b5683..58542c636 100644
--- a/i18n/en-US.json
+++ b/i18n/en-US.json
@@ -1776,6 +1776,8 @@
"dragOptionAria": "Reorder {{option}}",
"renameOptionAria": "Rename {{option}}",
"removeOptionAria": "Remove {{option}}",
+ "hideOptionAria": "Hide {{option}} from new selections",
+ "showOptionAria": "Offer {{option}} for new selections again",
"allowSeveral": "Allow several",
"allowSeveralDescription": "A task can pick more than one option.",
"requiredDescription": "Every task always has a value.",
diff --git a/i18n/es-ES.json b/i18n/es-ES.json
index 64153cee5..970a4dd6e 100644
--- a/i18n/es-ES.json
+++ b/i18n/es-ES.json
@@ -1572,6 +1572,8 @@
"noDefault": "Sin valor por defecto",
"optionsLabel": "Opciones",
"removeOptionAria": "Quitar {{option}}",
+ "hideOptionAria": "Ocultar {{option}} en nuevas selecciones",
+ "showOptionAria": "Volver a ofrecer {{option}} en nuevas selecciones",
"renameOptionAria": "Renombrar {{option}}",
"requiredDescription": "Todas las tareas tienen siempre un valor.",
"save": "Guardar",
diff --git a/i18n/fr-FR.json b/i18n/fr-FR.json
index 9931dca78..b1657212d 100644
--- a/i18n/fr-FR.json
+++ b/i18n/fr-FR.json
@@ -1572,6 +1572,8 @@
"noDefault": "Aucune valeur par défaut",
"optionsLabel": "Options",
"removeOptionAria": "Retirer {{option}}",
+ "hideOptionAria": "Masquer {{option}} pour les nouvelles sélections",
+ "showOptionAria": "Proposer à nouveau {{option}} pour les nouvelles sélections",
"renameOptionAria": "Renommer {{option}}",
"requiredDescription": "Chaque tâche a toujours une valeur.",
"save": "Enregistrer",
diff --git a/i18n/hi-IN.json b/i18n/hi-IN.json
index b1a333a0a..fca4c513a 100644
--- a/i18n/hi-IN.json
+++ b/i18n/hi-IN.json
@@ -1563,6 +1563,8 @@
"noDefault": "कोई डिफ़ॉल्ट नहीं",
"optionsLabel": "विकल्प",
"removeOptionAria": "{{option}} निकालें",
+ "hideOptionAria": "नए चयनों से {{option}} छिपाएँ",
+ "showOptionAria": "नए चयनों के लिए {{option}} फिर से दिखाएँ",
"renameOptionAria": "{{option}} का नाम बदलें",
"requiredDescription": "हर कार्य में हमेशा एक मान होता है।",
"save": "सहेजें",
diff --git a/i18n/id-ID.json b/i18n/id-ID.json
index d270462ce..b586b490f 100644
--- a/i18n/id-ID.json
+++ b/i18n/id-ID.json
@@ -1554,6 +1554,8 @@
"noDefault": "Tanpa default",
"optionsLabel": "Opsi",
"removeOptionAria": "Hapus {{option}}",
+ "hideOptionAria": "Sembunyikan {{option}} dari pilihan baru",
+ "showOptionAria": "Tawarkan lagi {{option}} untuk pilihan baru",
"renameOptionAria": "Ganti nama {{option}}",
"requiredDescription": "Setiap tugas selalu memiliki nilai.",
"save": "Simpan",
diff --git a/i18n/it-IT.json b/i18n/it-IT.json
index 22ea15e9e..8b30de625 100644
--- a/i18n/it-IT.json
+++ b/i18n/it-IT.json
@@ -1572,6 +1572,8 @@
"noDefault": "Nessun valore predefinito",
"optionsLabel": "Opzioni",
"removeOptionAria": "Rimuovi {{option}}",
+ "hideOptionAria": "Nascondi {{option}} dalle nuove selezioni",
+ "showOptionAria": "Offri di nuovo {{option}} per le nuove selezioni",
"renameOptionAria": "Rinomina {{option}}",
"requiredDescription": "Ogni attività ha sempre un valore.",
"save": "Salva",
diff --git a/i18n/ja-JP.json b/i18n/ja-JP.json
index b4c3a0b23..006aa1265 100644
--- a/i18n/ja-JP.json
+++ b/i18n/ja-JP.json
@@ -1554,6 +1554,8 @@
"noDefault": "デフォルトなし",
"optionsLabel": "選択肢",
"removeOptionAria": "{{option}} を削除",
+ "hideOptionAria": "{{option}} を新しい選択肢から非表示",
+ "showOptionAria": "{{option}} を新しい選択肢に再表示",
"renameOptionAria": "{{option}} の名前を変更",
"requiredDescription": "すべてのタスクに常に値が設定されます。",
"save": "保存",
diff --git a/i18n/ko-KR.json b/i18n/ko-KR.json
index a9d267ebf..83fbff813 100644
--- a/i18n/ko-KR.json
+++ b/i18n/ko-KR.json
@@ -1554,6 +1554,8 @@
"noDefault": "기본값 없음",
"optionsLabel": "옵션",
"removeOptionAria": "{{option}} 제거",
+ "hideOptionAria": "새 선택에서 {{option}} 숨기기",
+ "showOptionAria": "새 선택에 {{option}} 다시 표시",
"renameOptionAria": "{{option}} 이름 변경",
"requiredDescription": "모든 작업에 항상 값이 있습니다.",
"save": "저장",
diff --git a/i18n/mk-MK.json b/i18n/mk-MK.json
index 0b43416ff..732da917e 100644
--- a/i18n/mk-MK.json
+++ b/i18n/mk-MK.json
@@ -1563,6 +1563,8 @@
"noDefault": "Без стандардна вредност",
"optionsLabel": "Опции",
"removeOptionAria": "Отстрани {{option}}",
+ "hideOptionAria": "Скриј {{option}} од нови избори",
+ "showOptionAria": "Повторно понуди {{option}} за нови избори",
"renameOptionAria": "Преименувај {{option}}",
"requiredDescription": "Секоја задача секогаш има вредност.",
"save": "Зачувај",
diff --git a/i18n/nl-NL.json b/i18n/nl-NL.json
index cb6ba0006..39378291b 100644
--- a/i18n/nl-NL.json
+++ b/i18n/nl-NL.json
@@ -1563,6 +1563,8 @@
"noDefault": "Geen standaardwaarde",
"optionsLabel": "Opties",
"removeOptionAria": "{{option}} verwijderen",
+ "hideOptionAria": "{{option}} verbergen voor nieuwe selecties",
+ "showOptionAria": "{{option}} weer aanbieden voor nieuwe selecties",
"renameOptionAria": "{{option}} hernoemen",
"requiredDescription": "Elke taak heeft altijd een waarde.",
"save": "Opslaan",
diff --git a/i18n/pl-PL.json b/i18n/pl-PL.json
index d268e8a81..a36d1a860 100644
--- a/i18n/pl-PL.json
+++ b/i18n/pl-PL.json
@@ -2267,6 +2267,8 @@
"noDefault": "Brak wartości domyślnej",
"optionsLabel": "Opcje",
"removeOptionAria": "Usuń: {{option}}",
+ "hideOptionAria": "Ukryj w nowych wyborach: {{option}}",
+ "showOptionAria": "Przywróć w nowych wyborach: {{option}}",
"renameOptionAria": "Zmień nazwę: {{option}}",
"requiredDescription": "Każde zadanie zawsze ma wartość.",
"save": "Zapisz",
diff --git a/i18n/pt-BR.json b/i18n/pt-BR.json
index ee7377f92..d80144e87 100644
--- a/i18n/pt-BR.json
+++ b/i18n/pt-BR.json
@@ -1572,6 +1572,8 @@
"noDefault": "Sem padrão",
"optionsLabel": "Opções",
"removeOptionAria": "Remover {{option}}",
+ "hideOptionAria": "Ocultar {{option}} das novas seleções",
+ "showOptionAria": "Oferecer {{option}} novamente nas novas seleções",
"renameOptionAria": "Renomear {{option}}",
"requiredDescription": "Toda tarefa sempre tem um valor.",
"save": "Salvar",
diff --git a/i18n/ru-RU.json b/i18n/ru-RU.json
index 35295effd..51f5c1cc9 100644
--- a/i18n/ru-RU.json
+++ b/i18n/ru-RU.json
@@ -1589,6 +1589,8 @@
"noDefault": "Без значения по умолчанию",
"optionsLabel": "Варианты",
"removeOptionAria": "Удалить {{option}}",
+ "hideOptionAria": "Скрыть {{option}} из новых выборов",
+ "showOptionAria": "Снова предлагать {{option}} для новых выборов",
"renameOptionAria": "Переименовать {{option}}",
"requiredDescription": "У каждой задачи всегда есть значение.",
"save": "Сохранить",
diff --git a/i18n/tr-TR.json b/i18n/tr-TR.json
index b48599b2b..fca9b07b8 100644
--- a/i18n/tr-TR.json
+++ b/i18n/tr-TR.json
@@ -1563,6 +1563,8 @@
"noDefault": "Varsayılan yok",
"optionsLabel": "Seçenekler",
"removeOptionAria": "{{option}} seçeneğini kaldır",
+ "hideOptionAria": "{{option}} seçeneğini yeni seçimlerde gizle",
+ "showOptionAria": "{{option}} seçeneğini yeni seçimlerde yeniden sun",
"renameOptionAria": "{{option}} seçeneğini yeniden adlandır",
"requiredDescription": "Her talebin her zaman bir değeri olur.",
"save": "Kaydet",
diff --git a/i18n/uk-UA.json b/i18n/uk-UA.json
index 06c19ae37..8ad92c03b 100644
--- a/i18n/uk-UA.json
+++ b/i18n/uk-UA.json
@@ -1581,6 +1581,8 @@
"noDefault": "Без значення за замовчуванням",
"optionsLabel": "Варіанти",
"removeOptionAria": "Видалити {{option}}",
+ "hideOptionAria": "Приховати {{option}} з нових виборів",
+ "showOptionAria": "Знову пропонувати {{option}} для нових виборів",
"renameOptionAria": "Перейменувати {{option}}",
"requiredDescription": "Кожне завдання завжди має значення.",
"save": "Зберегти",
diff --git a/i18n/vi-VN.json b/i18n/vi-VN.json
index e79e28d27..60cd29db8 100644
--- a/i18n/vi-VN.json
+++ b/i18n/vi-VN.json
@@ -1554,6 +1554,8 @@
"noDefault": "Không có mặc định",
"optionsLabel": "Tùy chọn",
"removeOptionAria": "Gỡ {{option}}",
+ "hideOptionAria": "Ẩn {{option}} khỏi lựa chọn mới",
+ "showOptionAria": "Hiển thị lại {{option}} cho lựa chọn mới",
"renameOptionAria": "Đổi tên {{option}}",
"requiredDescription": "Mọi công việc luôn có giá trị.",
"save": "Lưu",
diff --git a/i18n/zh-CN.json b/i18n/zh-CN.json
index f0bef457d..2a896a465 100644
--- a/i18n/zh-CN.json
+++ b/i18n/zh-CN.json
@@ -1554,6 +1554,8 @@
"noDefault": "无默认值",
"optionsLabel": "选项",
"removeOptionAria": "移除 {{option}}",
+ "hideOptionAria": "在新选择中隐藏 {{option}}",
+ "showOptionAria": "在新选择中重新提供 {{option}}",
"renameOptionAria": "重命名 {{option}}",
"requiredDescription": "每个任务始终都有值。",
"save": "保存",
diff --git a/i18n/zh-TW.json b/i18n/zh-TW.json
index 37db4dcf8..eac2b75eb 100644
--- a/i18n/zh-TW.json
+++ b/i18n/zh-TW.json
@@ -1553,6 +1553,8 @@
"noDefault": "無預設值",
"optionsLabel": "選項",
"removeOptionAria": "移除 {{option}}",
+ "hideOptionAria": "在新選擇中隱藏 {{option}}",
+ "showOptionAria": "在新選擇中重新提供 {{option}}",
"renameOptionAria": "重新命名 {{option}}",
"requiredDescription": "每個任務一律會有值。",
"save": "儲存",
diff --git a/tests/api-integration/custom-field-hidden-options.test.ts b/tests/api-integration/custom-field-hidden-options.test.ts
new file mode 100644
index 000000000..0eaffc4b1
--- /dev/null
+++ b/tests/api-integration/custom-field-hidden-options.test.ts
@@ -0,0 +1,194 @@
+import { eq } from "drizzle-orm";
+import { beforeEach, describe, expect, it } from "vite-plus/test";
+import db, { schema } from "../../apps/api/src/database";
+import { createApp } from "../../apps/api/src/index";
+import { mockAuthenticatedSession } from "./helpers/auth";
+import { resetTestDatabase } from "./helpers/database";
+import {
+ createProjectFixture,
+ createWorkspaceMember,
+} from "./helpers/fixtures";
+
+beforeEach(resetTestDatabase);
+
+async function fixture(
+ field: Partial<typeof schema.customFieldDefinitionTable.$inferInsert> & {
+ type: string;
+ },
+) {
+ const member = await createWorkspaceMember({ role: "admin" });
+ const { project, columns } = await createProjectFixture({
+ workspaceId: member.workspace.id,
+ });
+ const [definition] = await db
+ .insert(schema.customFieldDefinitionTable)
+ .values({
+ projectId: project.id,
+ name: "Platform",
+ required: false,
+ position: 0,
+ ...field,
+ })
+ .returning();
+ const [task] = await db
+ .insert(schema.taskTable)
+ .values({
+ projectId: project.id,
+ title: "Task",
+ number: 1,
+ status: "to-do",
+ columnId: columns.todo.id,
+ })
+ .returning();
+ // Tasks created through the API claim numbers after this one.
+ await db
+ .update(schema.projectTable)
+ .set({ lastTaskNumber: 1 })
+ .where(eq(schema.projectTable.id, project.id));
+
+ mockAuthenticatedSession(member.user);
+ const { app } = createApp();
+ const json = (method: string, path: string, body: unknown) =>
+ app.request(path, {
+ method,
+ headers: { "content-type": "application/json" },
+ body: JSON.stringify(body),
+ });
+
+ return {
+ project,
+ field: definition,
+ task,
+ update: (body: Record<string, unknown>) =>
+ json("PUT", `/api/custom-field/${definition.id}`, body),
+ setValue: (value: string) =>
+ json("PUT", "/api/custom-field/value", {
+ taskId: task.id,
+ fieldId: definition.id,
+ value,
+ }),
+ createTask: (value: string) =>
+ json("POST", `/api/task/${project.id}`, {
+ title: "New task",
+ description: "",
+ status: "to-do",
+ priority: "no-priority",
+ customFields: [{ fieldId: definition.id, value }],
+ }),
+ };
+}
+
+async function storedValue(taskId: string) {
+ const [row] = await db
+ .select({ value: schema.customFieldValueTable.value })
+ .from(schema.customFieldValueTable)
+ .where(eq(schema.customFieldValueTable.taskId, taskId));
+ return row?.value;
+}
+
+describe("hidden custom field options", () => {
+ it("hides an option and returns it with the field", async () => {
+ const { update } = await fixture({
+ type: "dropdown",
+ options: ["Web", "iOS"],
+ });
+
+ const response = await update({ hiddenOptions: ["iOS"] });
+
+ expect(response.status).toBe(200);
+ expect(await response.json()).toMatchObject({
+ options: ["Web", "iOS"],
+ hiddenOptions: ["iOS"],
+ });
+ });
+
+ it("rejects hidden options that aren't options", async () => {
+ const { update } = await fixture({
+ type: "dropdown",
+ options: ["Web", "iOS"],
+ });
+
+ const response = await update({ hiddenOptions: ["Android"] });
+
+ expect(response.status).toBe(400);
+ });
+
+ it("refuses to hide the default", async () => {
+ const { update } = await fixture({
+ type: "dropdown",
+ options: ["Web", "iOS"],
+ defaultValue: "Web",
+ });
+
+ const response = await update({ hiddenOptions: ["Web"] });
+
+ expect(response.status).toBe(400);
+ expect(await response.text()).toContain("default");
+ });
+
+ it("drops a hidden option when the option itself is removed", async () => {
+ const { update } = await fixture({
+ type: "dropdown",
+ options: ["Web", "iOS", "Android"],
+ hiddenOptions: ["Android"],
+ });
+
+ const response = await update({ options: ["Web", "iOS"] });
+
+ expect(response.status).toBe(200);
+ expect((await response.json()).hiddenOptions).toEqual([]);
+ });
+
+ it("keeps a task's hidden selection but blocks picking it anew", async () => {
+ const { task, field, setValue } = await fixture({
+ type: "multiselect",
+ options: ["Web", "iOS", "Windows Phone"],
+ hiddenOptions: ["Windows Phone"],
+ });
+ await db.insert(schema.customFieldValueTable).values({
+ taskId: task.id,
+ fieldId: field.id,
+ value: JSON.stringify(["Windows Phone"]),
+ });
+
+ const kept = await setValue(JSON.stringify(["Windows Phone", "Web"]));
+ expect(kept.status).toBe(200);
+ expect(await storedValue(task.id)).toBe(
+ JSON.stringify(["Windows Phone", "Web"]),
+ );
+
+ expect((await setValue(JSON.stringify(["Web"]))).status).toBe(200);
+
+ const repicked = await setValue(JSON.stringify(["Web", "Windows Phone"]));
+ expect(repicked.status).toBe(400);
+ expect(await storedValue(task.id)).toBe(JSON.stringify(["Web"]));
+ });
+
+ it("rejects a hidden option on a dropdown and in task creation", async () => {
+ const { setValue, createTask } = await fixture({
+ type: "dropdown",
+ options: ["Web", "iOS"],
+ hiddenOptions: ["iOS"],
+ });
+
+ expect((await setValue("iOS")).status).toBe(400);
+ expect((await setValue("Web")).status).toBe(200);
+ expect((await createTask("iOS")).status).toBe(400);
+ expect((await createTask("Web")).status).toBe(200);
+ });
+
+ it("suggests hiding when an option in use can't be removed", async () => {
+ const { task, field, update } = await fixture({
+ type: "dropdown",
+ options: ["Web", "iOS"],
+ });
+ await db
+ .insert(schema.customFieldValueTable)
+ .values({ taskId: task.id, fieldId: field.id, value: "iOS" });
+
+ const response = await update({ options: ["Web"] });
+
+ expect(response.status).toBe(400);
+ expect(await response.text()).toContain("hide it");
+ });
+});