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

Tinb3d74aeeba80
diff --git a/apps/api/drizzle/0054_lowly_human_robot.sql b/apps/api/drizzle/0054_lowly_human_robot.sql
new file mode 100644
index 000000000..3d9e78cae
--- /dev/null
+++ b/apps/api/drizzle/0054_lowly_human_robot.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/0054_snapshot.json b/apps/api/drizzle/meta/0054_snapshot.json
new file mode 100644
index 000000000..af0455331
--- /dev/null
+++ b/apps/api/drizzle/meta/0054_snapshot.json
@@ -0,0 +1,4894 @@
+{
+ "id": "304515fa-46be-4743-9ae3-c50c39331a01",
+ "prevId": "0e589edc-d90f-4d1d-b5eb-e85c5f6f582e",
+ "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()"
+ },
+ "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()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "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": {}
+ }
+ },
+ "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()"
+ }
+ },
+ "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": {}
+ }
+ },
+ "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()"
+ }
+ },
+ "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()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "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()"
+ }
+ },
+ "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()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "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()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "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()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "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()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "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.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()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "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()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "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": {}
+ }
+ },
+ "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()"
+ }
+ },
+ "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.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()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "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()"
+ },
+ "inviter_id": {
+ "name": "inviter_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "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()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "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()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "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()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "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()"
+ },
+ "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_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()"
+ },
+ "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.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()"
+ }
+ },
+ "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()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "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()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "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_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()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "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()"
+ }
+ },
+ "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()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "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()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "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()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "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()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "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()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "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()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "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()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "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()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "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": {
+ "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": {}
+ }
+}
diff --git a/apps/api/drizzle/meta/_journal.json b/apps/api/drizzle/meta/_journal.json
index 4edeb1e76..ba6ff20cd 100644
--- a/apps/api/drizzle/meta/_journal.json
+++ b/apps/api/drizzle/meta/_journal.json
@@ -379,6 +379,13 @@
"when": 1790406015959,
"tag": "0053_calendar_feeds",
"breakpoints": true
+ },
+ {
+ "idx": 54,
+ "version": "7",
+ "when": 1790416050939,
+ "tag": "0054_lowly_human_robot",
+ "breakpoints": true
}
]
}
diff --git a/apps/api/src/custom-field/controllers/get-custom-field-values-by-project.ts b/apps/api/src/custom-field/controllers/get-custom-field-values-by-project.ts
index 0d0424166..a1f3743dd 100644
--- a/apps/api/src/custom-field/controllers/get-custom-field-values-by-project.ts
+++ b/apps/api/src/custom-field/controllers/get-custom-field-values-by-project.ts
@@ -17,6 +17,7 @@ async function getCustomFieldValuesByProject(projectId: string) {
fieldPosition: customFieldDefinitionTable.position,
fieldType: customFieldDefinitionTable.type,
fieldOptions: customFieldDefinitionTable.options,
+ fieldHiddenOptions: customFieldDefinitionTable.hiddenOptions,
})
.from(customFieldValueTable)
.innerJoin(taskTable, eq(customFieldValueTable.taskId, taskTable.id))
diff --git a/apps/api/src/custom-field/controllers/get-custom-field-values-by-task.ts b/apps/api/src/custom-field/controllers/get-custom-field-values-by-task.ts
index 19cb76c13..46dbf9d40 100644
--- a/apps/api/src/custom-field/controllers/get-custom-field-values-by-task.ts
+++ b/apps/api/src/custom-field/controllers/get-custom-field-values-by-task.ts
@@ -16,6 +16,7 @@ async function getCustomFieldValuesByTask(taskId: string) {
fieldPosition: customFieldDefinitionTable.position,
fieldType: customFieldDefinitionTable.type,
fieldOptions: customFieldDefinitionTable.options,
+ fieldHiddenOptions: customFieldDefinitionTable.hiddenOptions,
})
.from(customFieldValueTable)
.innerJoin(
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 9bc0f62d4..67843864d 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";
@@ -126,6 +126,52 @@ async function setCustomFieldValue(
}
}
+ if (
+ field.hiddenOptions.length &&
+ (field.type === "dropdown" || field.type === "multiselect")
+ ) {
+ const [previous] = await tx
+ .select({ value: customFieldValueTable.value })
+ .from(customFieldValueTable)
+ .where(
+ and(
+ eq(customFieldValueTable.taskId, taskId),
+ eq(customFieldValueTable.fieldId, fieldId),
+ ),
+ )
+ .for("update");
+ const oldSelections: string[] =
+ field.type === "dropdown"
+ ? [previous?.value ?? ""]
+ : (() => {
+ try {
+ const parsed: unknown = JSON.parse(previous?.value || "[]");
+ return Array.isArray(parsed)
+ ? parsed.filter(
+ (item): item is string => typeof item === "string",
+ )
+ : [];
+ } catch {
+ return [];
+ }
+ })();
+ const incoming: string[] =
+ field.type === "dropdown"
+ ? [normalizedValue]
+ : JSON.parse(normalizedValue || "[]");
+ if (
+ incoming.some(
+ (option) =>
+ field.hiddenOptions.includes(option) &&
+ !oldSelections.includes(option),
+ )
+ ) {
+ throw new HTTPException(400, {
+ message: "Hidden options cannot be selected for this task",
+ });
+ }
+ }
+
const [result] = await tx
.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 03e0662f4..b0e9be71c 100644
--- a/apps/api/src/custom-field/controllers/update-custom-field.ts
+++ b/apps/api/src/custom-field/controllers/update-custom-field.ts
@@ -6,6 +6,7 @@ import {
customFieldValueTable,
} from "../../database/schema";
import type { z } from "../../openapi";
+import { withoutHiddenOptions } from "../hidden-options";
import type { updateCustomFieldBody } from "../schema";
export default async function updateCustomField(
@@ -28,6 +29,7 @@ export default async function updateCustomField(
let options = field.options;
let defaultValue = field.defaultValue;
+ let hiddenOptions = field.hiddenOptions;
if (input.options !== undefined) {
if (field.type !== "dropdown" && field.type !== "multiselect") {
throw new HTTPException(400, {
@@ -57,6 +59,22 @@ export default async function updateCustomField(
message: "Not enough options for this field type",
});
}
+ hiddenOptions = input.options
+ .filter(
+ (option) =>
+ option.hidden ??
+ (option.originalValue !== undefined &&
+ field.hiddenOptions.includes(option.originalValue)),
+ )
+ .map((option) => option.value);
+ if (
+ field.required &&
+ newOptions.every((option) => hiddenOptions.includes(option))
+ ) {
+ throw new HTTPException(400, {
+ message: "Required fields must have at least one visible option",
+ });
+ }
const replacements = new Map(
input.options.flatMap((option) =>
option.originalValue === undefined
@@ -96,6 +114,10 @@ export default async function updateCustomField(
return JSON.stringify(selected.map(replace));
};
defaultValue = transform(defaultValue);
+ if (defaultValue !== null) {
+ defaultValue =
+ withoutHiddenOptions(defaultValue, field.type, hiddenOptions) || null;
+ }
const values = await tx
.select()
.from(customFieldValueTable)
@@ -121,7 +143,13 @@ export default async function updateCustomField(
}
const [updated] = await tx
.update(customFieldDefinitionTable)
- .set({ name: input.name, options, defaultValue, updatedAt: new Date() })
+ .set({
+ name: input.name,
+ options,
+ hiddenOptions,
+ defaultValue,
+ updatedAt: new Date(),
+ })
.where(eq(customFieldDefinitionTable.id, id))
.returning();
if (!updated)
diff --git a/apps/api/src/custom-field/hidden-options.ts b/apps/api/src/custom-field/hidden-options.ts
new file mode 100644
index 000000000..3dd199aed
--- /dev/null
+++ b/apps/api/src/custom-field/hidden-options.ts
@@ -0,0 +1,21 @@
+// Hidden selections remain valid on existing tasks, but must not seed new tasks.
+export function withoutHiddenOptions(
+ value: string,
+ type: string,
+ hiddenOptions: string[],
+): string {
+ if (!hiddenOptions.length || !value.trim()) return value;
+ if (type === "dropdown") return hiddenOptions.includes(value) ? "" : value;
+ if (type !== "multiselect") return value;
+ try {
+ const selected: unknown = JSON.parse(value);
+ if (!Array.isArray(selected)) return value;
+ const visible = selected.filter(
+ (option) => !hiddenOptions.includes(option),
+ );
+ return visible.length ? JSON.stringify(visible) : "";
+ } catch {
+ // Preserve malformed values for the normal validator to reject.
+ return value;
+ }
+}
diff --git a/apps/api/src/custom-field/index.ts b/apps/api/src/custom-field/index.ts
index 081dc227c..5ab9b476a 100644
--- a/apps/api/src/custom-field/index.ts
+++ b/apps/api/src/custom-field/index.ts
@@ -223,7 +223,7 @@ const updateCustomFieldRoute = createRoute({
tags: ["Custom Fields"],
summary: "Edit custom field",
description:
- "Rename a field or edit its selection options. Supply originalValue for existing options to preserve task selections and defaults when renaming. Omitted existing options are removed only when unused. The type and required setting are preserved. updatedAt must match the current definition.",
+ "Rename a field or edit its selection options. Supply originalValue for existing options to preserve task selections and defaults when renaming. Omitted existing options are removed only when unused. Hidden options remain on existing tasks but cannot be newly selected, and are removed from defaults. Required fields must retain a visible option. The type and required setting are preserved. updatedAt must match the current definition.",
middleware: [
workspaceAccess.fromCustomField("id"),
requireWorkspacePermission({ project: ["update"] }),
diff --git a/apps/api/src/custom-field/response.ts b/apps/api/src/custom-field/response.ts
index 468078480..d8385160b 100644
--- a/apps/api/src/custom-field/response.ts
+++ b/apps/api/src/custom-field/response.ts
@@ -9,6 +9,7 @@ export const customFieldDefinitionSchema = z
required: z.boolean(),
defaultValue: z.string().nullable(),
options: z.unknown().nullable(),
+ hiddenOptions: z.array(z.string()),
position: z.number(),
createdAt: responseTimestamp,
updatedAt: responseTimestamp,
@@ -29,6 +30,7 @@ export const customFieldValueSchema = z
fieldPosition: z.number(),
fieldType: z.string(),
fieldOptions: z.unknown().nullable(),
+ fieldHiddenOptions: z.array(z.string()),
})
.openapi("CustomFieldValue");
diff --git a/apps/api/src/custom-field/schema.ts b/apps/api/src/custom-field/schema.ts
index 60f60ee6f..1a6842936 100644
--- a/apps/api/src/custom-field/schema.ts
+++ b/apps/api/src/custom-field/schema.ts
@@ -51,6 +51,7 @@ export const updateCustomFieldBody = z
.array(
z.object({
originalValue: z.string().optional(),
+ hidden: z.boolean().optional(),
value: z.string().trim().min(1),
}),
)
diff --git a/apps/api/src/database/schema.ts b/apps/api/src/database/schema.ts
index 9705850fa..e01f46d1c 100644
--- a/apps/api/src/database/schema.ts
+++ b/apps/api/src/database/schema.ts
@@ -1241,6 +1241,10 @@ export const customFieldDefinitionTable = pgTable(
required: boolean("required").default(false).notNull(),
defaultValue: text("default_value"),
options: jsonb("options"),
+ hiddenOptions: jsonb("hidden_options")
+ .$type<string[]>()
+ .default([])
+ .notNull(),
position: integer("position").default(0).notNull(),
createdAt: timestamp("created_at", { mode: "date" }).defaultNow().notNull(),
updatedAt: timestamp("updated_at", { mode: "date" })
diff --git a/apps/api/src/task/controllers/duplicate-task.ts b/apps/api/src/task/controllers/duplicate-task.ts
index e28000e02..59bc025df 100644
--- a/apps/api/src/task/controllers/duplicate-task.ts
+++ b/apps/api/src/task/controllers/duplicate-task.ts
@@ -1,6 +1,7 @@
import { createId } from "@paralleldrive/cuid2";
import { and, eq } from "drizzle-orm";
import { HTTPException } from "hono/http-exception";
+import { withoutHiddenOptions } from "../../custom-field/hidden-options";
import db from "../../database";
import {
assetTable,
@@ -181,10 +182,19 @@ async function duplicateTask({
eq(customFieldDefinitionTable.projectId, sourceTask.projectId),
),
);
- const customFields = sourceCustomFields.map(({ fieldId, value }) => ({
- fieldId,
- value: value ?? "",
- }));
+ const customFields = sourceCustomFields.map(({ fieldId, value }) => {
+ const definition = fieldDefinitions.find((field) => field.id === fieldId);
+ return {
+ fieldId,
+ value: definition
+ ? withoutHiddenOptions(
+ value ?? "",
+ definition.type,
+ definition.hiddenOptions,
+ )
+ : (value ?? ""),
+ };
+ });
// Older tasks may predate a required field. Apply its current default or fail
// validation, just as creation does, before copying anything in storage.
for (const definition of fieldDefinitions) {
diff --git a/apps/api/src/task/validate-task-fields.ts b/apps/api/src/task/validate-task-fields.ts
index 2ccd1da43..fa0f851da 100644
--- a/apps/api/src/task/validate-task-fields.ts
+++ b/apps/api/src/task/validate-task-fields.ts
@@ -135,6 +135,7 @@ export async function assertRequiredCustomFields(
required: customFieldDefinitionTable.required,
defaultValue: customFieldDefinitionTable.defaultValue,
options: customFieldDefinitionTable.options,
+ hiddenOptions: customFieldDefinitionTable.hiddenOptions,
})
.from(customFieldDefinitionTable)
.where(eq(customFieldDefinitionTable.projectId, projectId));
@@ -173,7 +174,9 @@ export async function assertRequiredCustomFields(
cf.value,
type,
def.name,
- def.options,
+ Array.isArray(def.options)
+ ? def.options.filter((option) => !def.hiddenOptions.includes(option))
+ : def.options,
);
if (error) {
diff --git a/apps/docs/core/functional/create-workspace-and-project.mdx b/apps/docs/core/functional/create-workspace-and-project.mdx
index c7acea836..5166b051f 100644
--- a/apps/docs/core/functional/create-workspace-and-project.mdx
+++ b/apps/docs/core/functional/create-workspace-and-project.mdx
@@ -44,7 +44,7 @@ This keeps your board consistent from day one.
Open **Project settings → Workflow → Custom Fields** and use the pencil button beside a field to edit its name. For dropdown and multi-select fields, you can rename individual options, add options, or remove unused options.
-Renaming an option also updates existing task selections and the field's default value. An option used by a task or default cannot be removed. Field type and required settings stay unchanged. Editing requires the project's update permission.
+Renaming an option also updates existing task selections and the field's default value. An option used by a task or default cannot be removed. Use the eye button next to its trash icon to hide it instead, and use the same button to show it again. Hidden options remain on existing tasks and in historical filters, but disappear from selection menus and are removed from defaults. Existing hidden selections can be removed; once removed, they cannot be selected again until shown. Required fields must retain at least one visible option. If hiding removes their default, new tasks must explicitly choose a visible value. Field type and required settings stay unchanged. Editing requires the project's update permission.
## Next
diff --git a/apps/docs/openapi.json b/apps/docs/openapi.json
index a297175a0..bd257cf39 100644
--- a/apps/docs/openapi.json
+++ b/apps/docs/openapi.json
@@ -3744,6 +3744,12 @@
]
},
"options": {},
+ "hiddenOptions": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
"position": {
"type": "number"
},
@@ -3763,6 +3769,7 @@
"type",
"required",
"defaultValue",
+ "hiddenOptions",
"position",
"createdAt",
"updatedAt"
@@ -3795,7 +3802,13 @@
"fieldType": {
"type": "string"
},
- "fieldOptions": {}
+ "fieldOptions": {},
+ "fieldHiddenOptions": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ }
},
"required": [
"id",
@@ -3804,7 +3817,8 @@
"value",
"fieldName",
"fieldPosition",
- "fieldType"
+ "fieldType",
+ "fieldHiddenOptions"
]
},
"CustomFieldFilterValues": {
@@ -17008,7 +17022,7 @@
"Custom Fields"
],
"summary": "Edit custom field",
- "description": "Rename a field or edit its selection options. Supply originalValue for existing options to preserve task selections and defaults when renaming. Omitted existing options are removed only when unused. The type and required setting are preserved. updatedAt must match the current definition.",
+ "description": "Rename a field or edit its selection options. Supply originalValue for existing options to preserve task selections and defaults when renaming. Omitted existing options are removed only when unused. Hidden options remain on existing tasks but cannot be newly selected, and are removed from defaults. Required fields must retain a visible option. The type and required setting are preserved. updatedAt must match the current definition.",
"parameters": [
{
"schema": {
@@ -17042,6 +17056,9 @@
"originalValue": {
"type": "string"
},
+ "hidden": {
+ "type": "boolean"
+ },
"value": {
"type": "string",
"minLength": 1
diff --git a/apps/web/src/components/project/custom-field-editor.tsx b/apps/web/src/components/project/custom-field-editor.tsx
index 5f9feb3ff..be82bb5e6 100644
--- a/apps/web/src/components/project/custom-field-editor.tsx
+++ b/apps/web/src/components/project/custom-field-editor.tsx
@@ -62,6 +62,7 @@ export type CustomFieldDefinition = {
required: boolean;
defaultValue: string | null;
options: string[] | null;
+ hiddenOptions: string[];
position: number;
createdAt: string;
updatedAt: string;
diff --git a/apps/web/src/components/project/edit-custom-field-dialog.test.tsx b/apps/web/src/components/project/edit-custom-field-dialog.test.tsx
index 37013fa7e..78489c338 100644
--- a/apps/web/src/components/project/edit-custom-field-dialog.test.tsx
+++ b/apps/web/src/components/project/edit-custom-field-dialog.test.tsx
@@ -32,6 +32,7 @@ const field = {
required: false,
defaultValue: null,
options: ["Alice", "Bob"],
+ hiddenOptions: [],
position: 0,
createdAt: "2026-09-26T00:00:00.000Z",
updatedAt: "2026-09-26T00:00:00.000Z",
@@ -64,8 +65,8 @@ describe("edit custom field dialog", () => {
name: "Attendees",
updatedAt: field.updatedAt,
options: [
- { originalValue: "Alice", value: "Alex" },
- { originalValue: "Bob", value: "Bob" },
+ { originalValue: "Alice", value: "Alex", hidden: false },
+ { originalValue: "Bob", value: "Bob", hidden: false },
],
},
});
@@ -119,3 +120,32 @@ describe("edit custom field dialog", () => {
expect(screen.getAllByRole("textbox")).toHaveLength(3);
});
});
+
+it("toggles option visibility independently of deletion", async () => {
+ mutateAsync.mockResolvedValue({});
+ render(<EditCustomFieldDialog field={field} onClose={vi.fn()} />);
+ fireEvent.click(
+ screen.getByRole("button", { name: "settings:customFields.hideOption 1" }),
+ );
+ expect(
+ screen.getByRole("button", { name: "settings:customFields.showOption 1" }),
+ ).toBeVisible();
+ expect(
+ screen.getByLabelText("settings:customFields.optionLabel 1"),
+ ).toHaveValue("Alice");
+ fireEvent.click(
+ screen.getByRole("button", { name: "settings:customFields.saveButton" }),
+ );
+ await waitFor(() =>
+ expect(mutateAsync).toHaveBeenCalledWith(
+ expect.objectContaining({
+ json: expect.objectContaining({
+ options: [
+ { originalValue: "Alice", value: "Alice", hidden: true },
+ { originalValue: "Bob", value: "Bob", hidden: false },
+ ],
+ }),
+ }),
+ ),
+ );
+});
diff --git a/apps/web/src/components/project/edit-custom-field-dialog.tsx b/apps/web/src/components/project/edit-custom-field-dialog.tsx
index 373a9d9f3..10695881f 100644
--- a/apps/web/src/components/project/edit-custom-field-dialog.tsx
+++ b/apps/web/src/components/project/edit-custom-field-dialog.tsx
@@ -1,4 +1,4 @@
-import { Plus, Trash2 } from "lucide-react";
+import { Eye, EyeOff, Plus, Trash2 } from "lucide-react";
import { useRef, useState } from "react";
import { useTranslation } from "react-i18next";
import { Button } from "@/components/ui/button";
@@ -30,6 +30,7 @@ export default function EditCustomFieldDialog({
(field.options ?? []).map((value, key) => ({
key,
originalValue: value as string | undefined,
+ hidden: (field.hiddenOptions ?? []).includes(value),
value,
})),
);
@@ -42,7 +43,8 @@ export default function EditCustomFieldDialog({
(!hasOptions ||
(options.length >= (field.type === "multiselect" ? 2 : 1) &&
normalizedOptions.every(Boolean) &&
- new Set(normalizedOptions).size === options.length));
+ new Set(normalizedOptions).size === options.length &&
+ (!field.required || options.some((option) => !option.hidden))));
async function save() {
if (!valid || isPending) return;
@@ -55,8 +57,9 @@ export default function EditCustomFieldDialog({
updatedAt: field.updatedAt,
...(hasOptions
? {
- options: options.map(({ originalValue, value }) => ({
+ options: options.map(({ originalValue, value, hidden }) => ({
originalValue,
+ hidden,
value: value.trim(),
})),
}
@@ -133,6 +136,43 @@ export default function EditCustomFieldDialog({
)
}
/>
+ {option.hidden && (
+ <span className="text-xs text-muted-foreground">
+ {t("settings:customFields.hidden")}
+ </span>
+ )}
+ <Button
+ type="button"
+ variant="ghost"
+ size="icon"
+ aria-label={t(
+ option.hidden
+ ? "settings:customFields.showOption"
+ : "settings:customFields.hideOption",
+ { number: index + 1 },
+ )}
+ title={t(
+ option.hidden
+ ? "settings:customFields.showOption"
+ : "settings:customFields.hideOption",
+ { number: index + 1 },
+ )}
+ onClick={() =>
+ setOptions((current) =>
+ current.map((item) =>
+ item.key === option.key
+ ? { ...item, hidden: !item.hidden }
+ : item,
+ ),
+ )
+ }
+ >
+ {option.hidden ? (
+ <Eye className="size-4" />
+ ) : (
+ <EyeOff className="size-4" />
+ )}
+ </Button>
<Button
type="button"
variant="ghost"
@@ -158,7 +198,12 @@ export default function EditCustomFieldDialog({
const key = nextOptionKey.current++;
setOptions((current) => [
...current,
- { key, originalValue: undefined, value: "" },
+ {
+ key,
+ originalValue: undefined,
+ value: "",
+ hidden: false,
+ },
]);
}}
>
@@ -166,7 +211,8 @@ export default function EditCustomFieldDialog({
{t("settings:customFields.addOption")}
</Button>
<p className="text-xs text-muted-foreground">
- {t("settings:customFields.optionsEditHint")}
+ {t("settings:customFields.optionsEditHint")}{" "}
+ {t("settings:customFields.hiddenOptionsHint")}
</p>
</fieldset>
)}
diff --git a/apps/web/src/components/shared/modals/create-task-modal.test.tsx b/apps/web/src/components/shared/modals/create-task-modal.test.tsx
index cf9b18520..ac3bb9eee 100644
--- a/apps/web/src/components/shared/modals/create-task-modal.test.tsx
+++ b/apps/web/src/components/shared/modals/create-task-modal.test.tsx
@@ -35,12 +35,28 @@ const useLocation = vi.fn();
const deleteTask = vi.fn(async () => {});
const updateTask = vi.fn(async (input: Record<string, unknown>) => input);
const setProject = vi.fn();
+let customFields: {
+ id: string;
+ name: string;
+ type: string;
+ options: string[];
+ hiddenOptions: string[];
+ defaultValue: string;
+ required: boolean;
+}[] = [];
+vi.mock(
+ "@/hooks/queries/custom-field/use-get-custom-fields-by-project",
+ () => ({
+ default: () => ({ data: customFields }),
+ }),
+);
let workspaceId = "workspace-1";
let projects: { id: string; name: string; slug: string }[] | undefined;
let storedProject: { id: string; columns: unknown[] } | null = null;
let ensureTaskId: (() => Promise<string | null>) | undefined;
beforeEach(() => {
+ customFields = [];
workspaceId = "workspace-1";
projects = [
{ id: "project-1", name: "Alpha", slug: "alp" },
@@ -141,6 +157,40 @@ vi.mock("react-i18next", () => ({
}));
describe("CreateTaskModal", () => {
+ it("removes newly hidden selections from an open creation form", async () => {
+ useLocation.mockReturnValue({
+ pathname: "/dashboard/workspace/workspace-1/project/project-1/board",
+ });
+ customFields = [
+ {
+ id: "people",
+ name: "People",
+ type: "multiselect",
+ options: ["Former", "Current"],
+ hiddenOptions: [],
+ defaultValue: '["Former","Current"]',
+ required: false,
+ },
+ ];
+ const view = render(<CreateTaskModal open onClose={vi.fn()} />, {
+ wrapper: createWrapper(),
+ });
+ enterTitle();
+ customFields = customFields.map((field) => ({
+ ...field,
+ hiddenOptions: ["Former"],
+ }));
+ view.rerender(<CreateTaskModal open onClose={vi.fn()} />);
+ await act(async () => {
+ submit();
+ });
+ expect(createTask).toHaveBeenCalledWith(
+ expect.objectContaining({
+ customFields: [{ fieldId: "people", value: '["Current"]' }],
+ }),
+ );
+ });
+
it("keeps unsaved input while discard confirmation is open", async () => {
useLocation.mockReturnValue({
pathname: "/dashboard/workspace/workspace-1/project/project-1/board",
diff --git a/apps/web/src/components/shared/modals/create-task-modal.tsx b/apps/web/src/components/shared/modals/create-task-modal.tsx
index fe17af176..293af28ca 100644
--- a/apps/web/src/components/shared/modals/create-task-modal.tsx
+++ b/apps/web/src/components/shared/modals/create-task-modal.tsx
@@ -142,6 +142,7 @@ type CustomFieldDefinition = {
required: boolean;
defaultValue: string | null;
options: string[] | null;
+ hiddenOptions: string[];
position: number;
createdAt: string;
updatedAt: string;
@@ -311,10 +312,29 @@ function CreateTaskModalContent({
useEffect(() => {
setCustomFieldValues((previousValues) =>
Object.fromEntries(
- customFields.map((field) => [
- field.id,
- previousValues[field.id] ?? field.defaultValue ?? "",
- ]),
+ customFields.map((field) => {
+ let value = previousValues[field.id] ?? field.defaultValue ?? "";
+ const hidden = field.hiddenOptions ?? [];
+ if (
+ hidden.length &&
+ field.type === "dropdown" &&
+ hidden.includes(value)
+ ) {
+ value = "";
+ } else if (hidden.length && field.type === "multiselect" && value) {
+ try {
+ const selected: unknown = JSON.parse(value);
+ if (Array.isArray(selected)) {
+ value = JSON.stringify(
+ selected.filter((option) => !hidden.includes(option)),
+ );
+ }
+ } catch {
+ // Leave invalid input for the normal field validation.
+ }
+ }
+ return [field.id, value];
+ }),
),
);
}, [customFields]);
@@ -806,7 +826,9 @@ function CreateTaskModalContent({
switch (field.type) {
case "dropdown": {
- const options = field.options || [];
+ const options = (field.options ?? []).filter(
+ (option) => !(field.hiddenOptions ?? []).includes(option),
+ );
return (
<Select
@@ -887,7 +909,9 @@ function CreateTaskModalContent({
<Combobox
multiple={true}
autoHighlight
- items={Array.from(new Set(field.options ?? []))}
+ items={Array.from(new Set(field.options ?? [])).filter(
+ (option) => !(field.hiddenOptions ?? []).includes(option),
+ )}
value={selectedValues}
onValueChange={(val) =>
handleCustomFieldChange(field.id, JSON.stringify(val))
diff --git a/apps/web/src/components/task/custom-field-multi-select.test.tsx b/apps/web/src/components/task/custom-field-multi-select.test.tsx
index 16af7d402..0f1372ff9 100644
--- a/apps/web/src/components/task/custom-field-multi-select.test.tsx
+++ b/apps/web/src/components/task/custom-field-multi-select.test.tsx
@@ -10,7 +10,7 @@ import { afterEach, describe, expect, it, vi } from "vitest";
import CustomFieldMultiSelect from "./custom-field-multi-select";
vi.mock("react-i18next", () => ({
- useTranslation: () => ({ t: () => "Select option" }),
+ useTranslation: () => ({ t: (key: string) => key }),
}));
afterEach(cleanup);
const options = [
@@ -60,3 +60,39 @@ describe("custom field multi-select", () => {
expect(screen.getByRole("combobox", { name: "Attendees" })).toBeDisabled();
});
});
+
+it("keeps hidden selections readable and removable outside the menu", async () => {
+ const commit = vi.fn();
+ function Fixture() {
+ const [value, setValue] = useState([options[0]]);
+ return (
+ <CustomFieldMultiSelect
+ name="Attendees"
+ options={options}
+ hiddenOptions={[options[0]]}
+ value={value}
+ onChange={setValue}
+ onCommit={commit}
+ />
+ );
+ }
+ render(<Fixture />);
+ expect(screen.getByRole("listitem")).toHaveTextContent(options[0]);
+ fireEvent.click(screen.getByRole("combobox", { name: "Attendees" }));
+ expect(await screen.findByRole("option", { name: options[1] })).toBeVisible();
+ expect(
+ screen.queryByRole("option", { name: options[0] }),
+ ).not.toBeInTheDocument();
+ fireEvent.keyDown(screen.getByRole("option", { name: options[1] }), {
+ key: "Escape",
+ });
+ await waitFor(() =>
+ expect(screen.queryByRole("listbox")).not.toBeInTheDocument(),
+ );
+ fireEvent.click(
+ screen.getByRole("button", {
+ name: "settings:customFields.removeHiddenSelection",
+ }),
+ );
+ expect(commit).toHaveBeenLastCalledWith([]);
+});
diff --git a/apps/web/src/components/task/custom-field-multi-select.tsx b/apps/web/src/components/task/custom-field-multi-select.tsx
index 4d3f1561a..4125abe86 100644
--- a/apps/web/src/components/task/custom-field-multi-select.tsx
+++ b/apps/web/src/components/task/custom-field-multi-select.tsx
@@ -1,4 +1,6 @@
+import { EyeOff, X } from "lucide-react";
import { useTranslation } from "react-i18next";
+import { Button } from "@/components/ui/button";
import {
Select,
SelectContent,
@@ -11,6 +13,8 @@ type Props = {
name: string;
options: string[];
value: string[];
+ hiddenOptions?: string[];
+ required?: boolean;
disabled?: boolean;
onChange: (value: string[]) => void;
onCommit: (value: string[]) => void;
@@ -21,61 +25,106 @@ export default function CustomFieldMultiSelect({
options,
value,
disabled,
+ hiddenOptions = [],
+ required = false,
onChange,
onCommit,
}: Props) {
const { t } = useTranslation();
+ const visibleOptions = options.filter(
+ (option) => !hiddenOptions.includes(option),
+ );
+ const hiddenSelections = value.filter((option) =>
+ hiddenOptions.includes(option),
+ );
return (
- <Select
- multiple
- items={options.map((option) => ({ value: option, label: option }))}
- value={value}
- onValueChange={onChange}
- onOpenChange={(open) => {
- if (!open) onCommit(value);
- }}
- disabled={disabled || options.length === 0}
- >
- <SelectTrigger
- aria-label={name}
- className="h-9 w-full min-w-0 bg-background text-sm"
+ <div className="space-y-2">
+ <Select
+ multiple
+ items={visibleOptions.map((option) => ({
+ value: option,
+ label: option,
+ }))}
+ value={value}
+ onValueChange={onChange}
+ onOpenChange={(open) => {
+ if (!open) onCommit(value);
+ }}
+ disabled={disabled || visibleOptions.length === 0}
>
- <SelectValue
- className="min-w-0"
- title={value.join(", ")}
- placeholder={t("tasks:detail.selectOption")}
+ <SelectTrigger
+ aria-label={name}
+ className="h-9 w-full min-w-0 bg-background text-sm"
>
- {(selected: string[]) =>
- selected.length
- ? selected.join(", ")
- : t("tasks:detail.selectOption")
- }
- </SelectValue>
- {value.length > 1 && (
- <span
- aria-hidden="true"
- className="shrink-0 rounded bg-muted px-1.5 py-0.5 text-xs text-muted-foreground"
+ <SelectValue
+ className="min-w-0"
+ title={value.join(", ")}
+ placeholder={t("tasks:detail.selectOption")}
>
- {value.length}
- </span>
- )}
- </SelectTrigger>
- <SelectContent
- alignItemWithTrigger={false}
- className="w-(--anchor-width)"
- >
- {options.map((option) => (
- <SelectItem
- key={option}
- value={option}
- className="grid-cols-[1rem_minmax(0,1fr)] items-start py-1.5 leading-5"
- >
- <span className="block whitespace-normal break-words text-left">
- {option}
+ {(selected: string[]) =>
+ selected.length
+ ? selected.join(", ")
+ : t("tasks:detail.selectOption")
+ }
+ </SelectValue>
+ {value.length > 1 && (
+ <span
+ aria-hidden="true"
+ className="shrink-0 rounded bg-muted px-1.5 py-0.5 text-xs text-muted-foreground"
+ >
+ {value.length}
</span>
- </SelectItem>
- ))}
- </SelectContent>
- </Select>
+ )}
+ </SelectTrigger>
+ <SelectContent
+ alignItemWithTrigger={false}
+ className="w-(--anchor-width)"
+ >
+ {visibleOptions.map((option) => (
+ <SelectItem
+ key={option}
+ value={option}
+ className="grid-cols-[1rem_minmax(0,1fr)] items-start py-1.5 leading-5"
+ >
+ <span className="block whitespace-normal break-words text-left">
+ {option}
+ </span>
+ </SelectItem>
+ ))}
+ </SelectContent>
+ </Select>
+ {hiddenSelections.length > 0 && (
+ <ul className="space-y-1">
+ {hiddenSelections.map((option) => (
+ <li
+ key={option}
+ className="flex items-start gap-1.5 text-xs text-muted-foreground"
+ >
+ <EyeOff aria-hidden="true" className="mt-0.5 size-3.5 shrink-0" />
+ <span className="min-w-0 flex-1 break-words">
+ {option} · {t("settings:customFields.hidden")}
+ </span>
+ <Button
+ type="button"
+ variant="ghost"
+ size="icon"
+ className="size-5 shrink-0"
+ disabled={disabled || (required && value.length === 1)}
+ aria-label={t("settings:customFields.removeHiddenSelection", {
+ option,
+ })}
+ onClick={() => {
+ const next = value.filter((item) => item !== option);
+ onChange(next);
+ onCommit(next);
+ }}
+ >
+ <X className="size-3" />
+ </Button>
+ </li>
+ ))}
+ </ul>
+ )}
+ </div>
);
}
diff --git a/apps/web/src/components/task/task-details-content.tsx b/apps/web/src/components/task/task-details-content.tsx
index 58d6051b3..4058525b9 100644
--- a/apps/web/src/components/task/task-details-content.tsx
+++ b/apps/web/src/components/task/task-details-content.tsx
@@ -65,6 +65,7 @@ type CustomFieldDefinition = {
required: boolean;
defaultValue: string | null;
options: string[] | null;
+ hiddenOptions: string[];
position: number;
createdAt: string;
updatedAt: string;
@@ -274,6 +275,10 @@ export default function TaskDetailsContent({
{field.type === "dropdown" ? (
<Select
+ items={(field.options ?? []).map((option) => ({
+ value: option,
+ label: option,
+ }))}
value={textVal}
onValueChange={(newVal) => {
handleLocalChange(field.id, newVal as string);
@@ -283,11 +288,12 @@ export default function TaskDetailsContent({
>
<SelectTrigger className="h-9 w-full bg-background text-sm">
<SelectValue
- placeholder={t(
- "tasks:detail.selectOption",
- "Select option",
- )}
- />
+ placeholder={t("tasks:detail.selectOption")}
+ >
+ {textVal
+ ? `${textVal}${(field.hiddenOptions ?? []).includes(textVal) ? ` · ${t("settings:customFields.hidden")}` : ""}`
+ : t("tasks:detail.selectOption")}
+ </SelectValue>
</SelectTrigger>
<SelectContent
alignItemWithTrigger={false}
@@ -298,15 +304,20 @@ export default function TaskDetailsContent({
{t("tasks:detail.selectOption")}
</SelectItem>
)}
- {Array.from(new Set(field.options || [])).map(
- (opt) => (
+ {Array.from(new Set(field.options || []))
+ .filter(
+ (option) =>
+ !(field.hiddenOptions ?? []).includes(
+ option,
+ ),
+ )
+ .map((opt) => (
<SelectItem key={opt} value={opt}>
<span className="block min-w-0 whitespace-normal break-words text-left">
{opt}
</span>
</SelectItem>
- ),
- )}
+ ))}
</SelectContent>
</Select>
) : field.type === "date" ? (
@@ -458,6 +469,8 @@ export default function TaskDetailsContent({
) : field.type === "multiselect" ? (
<CustomFieldMultiSelect
name={field.name}
+ hiddenOptions={field.hiddenOptions}
+ required={field.required}
options={Array.from(new Set(field.options ?? []))}
value={multiselectVal}
disabled={!canEdit}
diff --git a/i18n/az-AZ.json b/i18n/az-AZ.json
index 291fe38e2..79740f4b0 100644
--- a/i18n/az-AZ.json
+++ b/i18n/az-AZ.json
@@ -1505,7 +1505,12 @@
"removeOption": "Remove option {{number}}",
"updateError": "Failed to update custom field",
"updateSuccess": "Custom field updated",
- "saveButton": "Save changes"
+ "saveButton": "Save changes",
+ "hideOption": "Hide option {{number}}",
+ "showOption": "Show option {{number}}",
+ "hidden": "Hidden",
+ "hiddenOptionsHint": "Hidden options remain on existing tasks but are excluded from new selections and defaults. Required fields must keep at least one visible option.",
+ "removeHiddenSelection": "Remove {{option}}"
},
"administration": "Administration",
"adminUsers": {
diff --git a/i18n/de-DE.json b/i18n/de-DE.json
index 105a9cd8f..dbbeee857 100644
--- a/i18n/de-DE.json
+++ b/i18n/de-DE.json
@@ -1585,7 +1585,12 @@
"removeOption": "Option {{number}} entfernen",
"addOption": "Option hinzufügen",
"optionsEditHint": "Umbenennungen aktualisieren die Auswahl in bestehenden Aufgaben und die Standardwerte. Verwendete Optionen können nicht entfernt werden.",
- "saveButton": "Speichern"
+ "saveButton": "Speichern",
+ "hideOption": "Option {{number}} ausblenden",
+ "showOption": "Option {{number}} wieder einblenden",
+ "hidden": "Ausgeblendet",
+ "hiddenOptionsHint": "Ausgeblendete Optionen bleiben in bestehenden Aufgaben erhalten, werden aber aus der Auswahl und den Standardwerten entfernt. Bei Pflichtfeldern muss mindestens eine Option sichtbar bleiben.",
+ "removeHiddenSelection": "{{option}} entfernen"
},
"security": "Security",
"securityPage": {
diff --git a/i18n/el-GR.json b/i18n/el-GR.json
index e82fb202f..5cac73569 100644
--- a/i18n/el-GR.json
+++ b/i18n/el-GR.json
@@ -1505,7 +1505,12 @@
"removeOption": "Remove option {{number}}",
"updateError": "Failed to update custom field",
"updateSuccess": "Custom field updated",
- "saveButton": "Save changes"
+ "saveButton": "Save changes",
+ "hideOption": "Hide option {{number}}",
+ "showOption": "Show option {{number}}",
+ "hidden": "Hidden",
+ "hiddenOptionsHint": "Hidden options remain on existing tasks but are excluded from new selections and defaults. Required fields must keep at least one visible option.",
+ "removeHiddenSelection": "Remove {{option}}"
},
"administration": "Administration",
"adminUsers": {
diff --git a/i18n/en-US.json b/i18n/en-US.json
index 23b2a57a7..f2ebd9774 100644
--- a/i18n/en-US.json
+++ b/i18n/en-US.json
@@ -1163,7 +1163,12 @@
"removeOption": "Remove option {{number}}",
"addOption": "Add option",
"optionsEditHint": "Renaming an option updates existing task selections and defaults. Options in use cannot be removed.",
- "saveButton": "Save changes"
+ "saveButton": "Save changes",
+ "hideOption": "Hide option {{number}}",
+ "showOption": "Show option {{number}}",
+ "hidden": "Hidden",
+ "hiddenOptionsHint": "Hidden options remain on existing tasks but are excluded from new selections and defaults. Required fields must keep at least one visible option.",
+ "removeHiddenSelection": "Remove {{option}}"
},
"githubIntegration": {
"validation": {
diff --git a/i18n/es-ES.json b/i18n/es-ES.json
index ae57c9f28..f16eaa2f0 100644
--- a/i18n/es-ES.json
+++ b/i18n/es-ES.json
@@ -1506,7 +1506,12 @@
"removeOption": "Remove option {{number}}",
"updateError": "Failed to update custom field",
"updateSuccess": "Custom field updated",
- "saveButton": "Save changes"
+ "saveButton": "Save changes",
+ "hideOption": "Hide option {{number}}",
+ "showOption": "Show option {{number}}",
+ "hidden": "Hidden",
+ "hiddenOptionsHint": "Hidden options remain on existing tasks but are excluded from new selections and defaults. Required fields must keep at least one visible option.",
+ "removeHiddenSelection": "Remove {{option}}"
},
"administration": "Administration",
"adminUsers": {
diff --git a/i18n/fr-FR.json b/i18n/fr-FR.json
index 300491908..42aeb3b2b 100644
--- a/i18n/fr-FR.json
+++ b/i18n/fr-FR.json
@@ -1506,7 +1506,12 @@
"removeOption": "Remove option {{number}}",
"updateError": "Failed to update custom field",
"updateSuccess": "Custom field updated",
- "saveButton": "Save changes"
+ "saveButton": "Save changes",
+ "hideOption": "Hide option {{number}}",
+ "showOption": "Show option {{number}}",
+ "hidden": "Hidden",
+ "hiddenOptionsHint": "Hidden options remain on existing tasks but are excluded from new selections and defaults. Required fields must keep at least one visible option.",
+ "removeHiddenSelection": "Remove {{option}}"
},
"administration": "Administration",
"adminUsers": {
diff --git a/i18n/hi-IN.json b/i18n/hi-IN.json
index 01637853f..db14ea2bd 100644
--- a/i18n/hi-IN.json
+++ b/i18n/hi-IN.json
@@ -1505,7 +1505,12 @@
"removeOption": "Remove option {{number}}",
"updateError": "Failed to update custom field",
"updateSuccess": "Custom field updated",
- "saveButton": "Save changes"
+ "saveButton": "Save changes",
+ "hideOption": "Hide option {{number}}",
+ "showOption": "Show option {{number}}",
+ "hidden": "Hidden",
+ "hiddenOptionsHint": "Hidden options remain on existing tasks but are excluded from new selections and defaults. Required fields must keep at least one visible option.",
+ "removeHiddenSelection": "Remove {{option}}"
},
"administration": "Administration",
"adminUsers": {
diff --git a/i18n/id-ID.json b/i18n/id-ID.json
index 98d5f886c..2ac9d3503 100644
--- a/i18n/id-ID.json
+++ b/i18n/id-ID.json
@@ -1504,7 +1504,12 @@
"removeOption": "Remove option {{number}}",
"updateError": "Failed to update custom field",
"updateSuccess": "Custom field updated",
- "saveButton": "Save changes"
+ "saveButton": "Save changes",
+ "hideOption": "Hide option {{number}}",
+ "showOption": "Show option {{number}}",
+ "hidden": "Hidden",
+ "hiddenOptionsHint": "Hidden options remain on existing tasks but are excluded from new selections and defaults. Required fields must keep at least one visible option.",
+ "removeHiddenSelection": "Remove {{option}}"
},
"administration": "Administration",
"adminUsers": {
diff --git a/i18n/it-IT.json b/i18n/it-IT.json
index 41a0e6b34..15827a5d7 100644
--- a/i18n/it-IT.json
+++ b/i18n/it-IT.json
@@ -1506,7 +1506,12 @@
"removeOption": "Remove option {{number}}",
"updateError": "Failed to update custom field",
"updateSuccess": "Custom field updated",
- "saveButton": "Save changes"
+ "saveButton": "Save changes",
+ "hideOption": "Hide option {{number}}",
+ "showOption": "Show option {{number}}",
+ "hidden": "Hidden",
+ "hiddenOptionsHint": "Hidden options remain on existing tasks but are excluded from new selections and defaults. Required fields must keep at least one visible option.",
+ "removeHiddenSelection": "Remove {{option}}"
},
"administration": "Administration",
"adminUsers": {
diff --git a/i18n/ja-JP.json b/i18n/ja-JP.json
index 7568f4160..a263e6b53 100644
--- a/i18n/ja-JP.json
+++ b/i18n/ja-JP.json
@@ -1504,7 +1504,12 @@
"removeOption": "Remove option {{number}}",
"updateError": "Failed to update custom field",
"updateSuccess": "Custom field updated",
- "saveButton": "Save changes"
+ "saveButton": "Save changes",
+ "hideOption": "Hide option {{number}}",
+ "showOption": "Show option {{number}}",
+ "hidden": "Hidden",
+ "hiddenOptionsHint": "Hidden options remain on existing tasks but are excluded from new selections and defaults. Required fields must keep at least one visible option.",
+ "removeHiddenSelection": "Remove {{option}}"
},
"administration": "Administration",
"adminUsers": {
diff --git a/i18n/ko-KR.json b/i18n/ko-KR.json
index 9de467680..fdfc7a55f 100644
--- a/i18n/ko-KR.json
+++ b/i18n/ko-KR.json
@@ -1504,7 +1504,12 @@
"removeOption": "Remove option {{number}}",
"updateError": "Failed to update custom field",
"updateSuccess": "Custom field updated",
- "saveButton": "Save changes"
+ "saveButton": "Save changes",
+ "hideOption": "Hide option {{number}}",
+ "showOption": "Show option {{number}}",
+ "hidden": "Hidden",
+ "hiddenOptionsHint": "Hidden options remain on existing tasks but are excluded from new selections and defaults. Required fields must keep at least one visible option.",
+ "removeHiddenSelection": "Remove {{option}}"
},
"administration": "Administration",
"adminUsers": {
diff --git a/i18n/mk-MK.json b/i18n/mk-MK.json
index 78674b872..13279bd68 100644
--- a/i18n/mk-MK.json
+++ b/i18n/mk-MK.json
@@ -1505,7 +1505,12 @@
"removeOption": "Remove option {{number}}",
"updateError": "Failed to update custom field",
"updateSuccess": "Custom field updated",
- "saveButton": "Save changes"
+ "saveButton": "Save changes",
+ "hideOption": "Hide option {{number}}",
+ "showOption": "Show option {{number}}",
+ "hidden": "Hidden",
+ "hiddenOptionsHint": "Hidden options remain on existing tasks but are excluded from new selections and defaults. Required fields must keep at least one visible option.",
+ "removeHiddenSelection": "Remove {{option}}"
},
"administration": "Administration",
"adminUsers": {
diff --git a/i18n/nl-NL.json b/i18n/nl-NL.json
index e9a3f2d03..6b52285d0 100644
--- a/i18n/nl-NL.json
+++ b/i18n/nl-NL.json
@@ -1505,7 +1505,12 @@
"removeOption": "Remove option {{number}}",
"updateError": "Failed to update custom field",
"updateSuccess": "Custom field updated",
- "saveButton": "Save changes"
+ "saveButton": "Save changes",
+ "hideOption": "Hide option {{number}}",
+ "showOption": "Show option {{number}}",
+ "hidden": "Hidden",
+ "hiddenOptionsHint": "Hidden options remain on existing tasks but are excluded from new selections and defaults. Required fields must keep at least one visible option.",
+ "removeHiddenSelection": "Remove {{option}}"
},
"administration": "Administration",
"adminUsers": {
diff --git a/i18n/pl-PL.json b/i18n/pl-PL.json
index 8a81bcb04..d4efb3a5f 100644
--- a/i18n/pl-PL.json
+++ b/i18n/pl-PL.json
@@ -1984,7 +1984,12 @@
"removeOption": "Remove option {{number}}",
"updateError": "Failed to update custom field",
"updateSuccess": "Custom field updated",
- "saveButton": "Save changes"
+ "saveButton": "Save changes",
+ "hideOption": "Hide option {{number}}",
+ "showOption": "Show option {{number}}",
+ "hidden": "Hidden",
+ "hiddenOptionsHint": "Hidden options remain on existing tasks but are excluded from new selections and defaults. Required fields must keep at least one visible option.",
+ "removeHiddenSelection": "Remove {{option}}"
},
"administration": "Administration",
"adminUsers": {
diff --git a/i18n/pt-BR.json b/i18n/pt-BR.json
index d45036578..4957dc692 100644
--- a/i18n/pt-BR.json
+++ b/i18n/pt-BR.json
@@ -1506,7 +1506,12 @@
"removeOption": "Remove option {{number}}",
"updateError": "Failed to update custom field",
"updateSuccess": "Custom field updated",
- "saveButton": "Save changes"
+ "saveButton": "Save changes",
+ "hideOption": "Hide option {{number}}",
+ "showOption": "Show option {{number}}",
+ "hidden": "Hidden",
+ "hiddenOptionsHint": "Hidden options remain on existing tasks but are excluded from new selections and defaults. Required fields must keep at least one visible option.",
+ "removeHiddenSelection": "Remove {{option}}"
},
"administration": "Administration",
"adminUsers": {
diff --git a/i18n/ru-RU.json b/i18n/ru-RU.json
index fee6966d8..de89ea8e7 100644
--- a/i18n/ru-RU.json
+++ b/i18n/ru-RU.json
@@ -1515,7 +1515,12 @@
"removeOption": "Remove option {{number}}",
"updateError": "Failed to update custom field",
"updateSuccess": "Custom field updated",
- "saveButton": "Save changes"
+ "saveButton": "Save changes",
+ "hideOption": "Hide option {{number}}",
+ "showOption": "Show option {{number}}",
+ "hidden": "Hidden",
+ "hiddenOptionsHint": "Hidden options remain on existing tasks but are excluded from new selections and defaults. Required fields must keep at least one visible option.",
+ "removeHiddenSelection": "Remove {{option}}"
},
"administration": "Administration",
"adminUsers": {
diff --git a/i18n/schema.json b/i18n/schema.json
index 1094c7da6..f477b07c0 100644
--- a/i18n/schema.json
+++ b/i18n/schema.json
@@ -4535,6 +4535,21 @@
},
"saveButton": {
"type": "string"
+ },
+ "hideOption": {
+ "type": "string"
+ },
+ "showOption": {
+ "type": "string"
+ },
+ "hidden": {
+ "type": "string"
+ },
+ "hiddenOptionsHint": {
+ "type": "string"
+ },
+ "removeHiddenSelection": {
+ "type": "string"
}
},
"required": [
@@ -4571,7 +4586,12 @@
"removeOption",
"addOption",
"optionsEditHint",
- "saveButton"
+ "saveButton",
+ "hideOption",
+ "showOption",
+ "hidden",
+ "hiddenOptionsHint",
+ "removeHiddenSelection"
]
},
"githubIntegration": {
diff --git a/i18n/tr-TR.json b/i18n/tr-TR.json
index ca95aea34..696496aa4 100644
--- a/i18n/tr-TR.json
+++ b/i18n/tr-TR.json
@@ -1505,7 +1505,12 @@
"removeOption": "Remove option {{number}}",
"updateError": "Failed to update custom field",
"updateSuccess": "Custom field updated",
- "saveButton": "Save changes"
+ "saveButton": "Save changes",
+ "hideOption": "Hide option {{number}}",
+ "showOption": "Show option {{number}}",
+ "hidden": "Hidden",
+ "hiddenOptionsHint": "Hidden options remain on existing tasks but are excluded from new selections and defaults. Required fields must keep at least one visible option.",
+ "removeHiddenSelection": "Remove {{option}}"
},
"administration": "Administration",
"adminUsers": {
diff --git a/i18n/uk-UA.json b/i18n/uk-UA.json
index ec29ddbcd..08437ab19 100644
--- a/i18n/uk-UA.json
+++ b/i18n/uk-UA.json
@@ -1507,7 +1507,12 @@
"removeOption": "Remove option {{number}}",
"updateError": "Failed to update custom field",
"updateSuccess": "Custom field updated",
- "saveButton": "Save changes"
+ "saveButton": "Save changes",
+ "hideOption": "Hide option {{number}}",
+ "showOption": "Show option {{number}}",
+ "hidden": "Hidden",
+ "hiddenOptionsHint": "Hidden options remain on existing tasks but are excluded from new selections and defaults. Required fields must keep at least one visible option.",
+ "removeHiddenSelection": "Remove {{option}}"
},
"administration": "Administration",
"adminUsers": {
diff --git a/i18n/vi-VN.json b/i18n/vi-VN.json
index d5e15c28d..5bca51eaf 100644
--- a/i18n/vi-VN.json
+++ b/i18n/vi-VN.json
@@ -1504,7 +1504,12 @@
"removeOption": "Remove option {{number}}",
"updateError": "Failed to update custom field",
"updateSuccess": "Custom field updated",
- "saveButton": "Save changes"
+ "saveButton": "Save changes",
+ "hideOption": "Hide option {{number}}",
+ "showOption": "Show option {{number}}",
+ "hidden": "Hidden",
+ "hiddenOptionsHint": "Hidden options remain on existing tasks but are excluded from new selections and defaults. Required fields must keep at least one visible option.",
+ "removeHiddenSelection": "Remove {{option}}"
},
"administration": "Administration",
"adminUsers": {
diff --git a/i18n/zh-CN.json b/i18n/zh-CN.json
index 73bcdde0c..5a42ee33f 100644
--- a/i18n/zh-CN.json
+++ b/i18n/zh-CN.json
@@ -1504,7 +1504,12 @@
"removeOption": "Remove option {{number}}",
"updateError": "Failed to update custom field",
"updateSuccess": "Custom field updated",
- "saveButton": "Save changes"
+ "saveButton": "Save changes",
+ "hideOption": "Hide option {{number}}",
+ "showOption": "Show option {{number}}",
+ "hidden": "Hidden",
+ "hiddenOptionsHint": "Hidden options remain on existing tasks but are excluded from new selections and defaults. Required fields must keep at least one visible option.",
+ "removeHiddenSelection": "Remove {{option}}"
},
"administration": "Administration",
"adminUsers": {
diff --git a/tests/api-integration/custom-field-edit.test.ts b/tests/api-integration/custom-field-edit.test.ts
index 63cbab3c8..ceba583bc 100644
--- a/tests/api-integration/custom-field-edit.test.ts
+++ b/tests/api-integration/custom-field-edit.test.ts
@@ -42,6 +42,10 @@ async function fixture(type = "multiselect", role = "admin") {
fieldId: field.id,
value: type === "multiselect" ? '["Alice","Bob"]' : "Alice",
});
+ await db
+ .update(schema.projectTable)
+ .set({ lastTaskNumber: 1 })
+ .where(eq(schema.projectTable.id, project.id));
mockAuthenticatedSession(member.user);
const { app } = createApp();
const update = (body: Record<string, unknown> = {}) =>
@@ -212,3 +216,151 @@ describe("custom field editing", () => {
expect([401, 403]).toContain((await update()).status);
});
});
+
+describe("hidden custom field options", () => {
+ it.each(["dropdown", "multiselect"])(
+ "hides and restores %s options while preserving history",
+ async (type) => {
+ const { update, readValue, field, task, app } = await fixture(type);
+ const options = [
+ { originalValue: "Alice", value: "Alice", hidden: true },
+ { originalValue: "Bob", value: "Bob" },
+ { originalValue: "Unused", value: "Unused" },
+ ];
+ const response = await update({ options });
+ expect(response.status).toBe(200);
+ const hidden = await response.json();
+ expect(hidden).toMatchObject({
+ hiddenOptions: ["Alice"],
+ defaultValue: null,
+ });
+ const original = type === "multiselect" ? '["Alice","Bob"]' : "Alice";
+ expect(await readValue()).toBe(original);
+ const metadata = await app.request(`/api/custom-field/task/${task.id}`);
+ expect(await metadata.json()).toEqual(
+ expect.arrayContaining([
+ expect.objectContaining({
+ fieldHiddenOptions: ["Alice"],
+ value: original,
+ }),
+ ]),
+ );
+ const set = (value: string) =>
+ app.request("/api/custom-field/value", {
+ method: "PUT",
+ headers: { "Content-Type": "application/json" },
+ body: JSON.stringify({ taskId: task.id, fieldId: field.id, value }),
+ });
+ expect((await set(original)).status).toBe(200);
+ expect(
+ (await set(type === "multiselect" ? '["Bob"]' : "Bob")).status,
+ ).toBe(200);
+ expect((await set(original)).status).toBe(400);
+ const shown = await update({
+ updatedAt: hidden.updatedAt,
+ options: options.map((option) => ({ ...option, hidden: false })),
+ });
+ expect(shown.status).toBe(200);
+ expect(await shown.json()).toMatchObject({ hiddenOptions: [] });
+ expect((await set(original)).status).toBe(200);
+ },
+ );
+
+ it("does not allow hidden selections on a new task or copy them to a duplicate", async () => {
+ const { update, field, task, app, project } = await fixture();
+ await update({
+ options: [
+ { originalValue: "Alice", value: "Alice", hidden: true },
+ { originalValue: "Bob", value: "Bob" },
+ ],
+ });
+ for (const [value, status] of [
+ ['["Alice"]', 400],
+ ['["Bob"]', 200],
+ ] as const) {
+ const response = await app.request(`/api/task/${project.id}`, {
+ method: "POST",
+ headers: { "Content-Type": "application/json" },
+ body: JSON.stringify({
+ title: "New task",
+ description: "",
+ status: "to-do",
+ priority: "no-priority",
+ customFields: [{ fieldId: field.id, value }],
+ }),
+ });
+ expect(response.status, await response.clone().text()).toBe(status);
+ }
+ const duplicate = await app.request(`/api/task/duplicate/${task.id}`, {
+ method: "POST",
+ headers: { "Content-Type": "application/json" },
+ body: "{}",
+ });
+ expect(duplicate.status, await duplicate.clone().text()).toBe(200);
+ const copied = await duplicate.json();
+ const value = await db.query.customFieldValueTable.findFirst({
+ where: eq(schema.customFieldValueTable.taskId, copied.id),
+ });
+ expect(value?.value).toBe('["Bob"]');
+ });
+
+ it("preserves hidden status when an older client renames options", async () => {
+ const { update, readValue } = await fixture();
+ const hidden = await (
+ await update({
+ options: [
+ { originalValue: "Alice", value: "Alice", hidden: true },
+ { originalValue: "Bob", value: "Bob" },
+ ],
+ })
+ ).json();
+ const response = await update({
+ updatedAt: hidden.updatedAt,
+ options: [
+ { originalValue: "Alice", value: "Alex" },
+ { originalValue: "Bob", value: "Bob" },
+ ],
+ });
+ expect(response.status).toBe(200);
+ expect(await response.json()).toMatchObject({ hiddenOptions: ["Alex"] });
+ expect(await readValue()).toBe('["Alex","Bob"]');
+ });
+
+ it("allows hiding every option only for optional fields", async () => {
+ const { update, field } = await fixture();
+ const options = [
+ { originalValue: "Alice", value: "Alice", hidden: true },
+ { originalValue: "Bob", value: "Bob", hidden: true },
+ ];
+ expect((await update({ options })).status).toBe(200);
+ const [required] = await db
+ .update(schema.customFieldDefinitionTable)
+ .set({ required: true })
+ .where(eq(schema.customFieldDefinitionTable.id, field.id))
+ .returning();
+ expect(
+ (await update({ options, updatedAt: required.updatedAt.toISOString() }))
+ .status,
+ ).toBe(400);
+ });
+
+ it("clears only hidden defaults and keeps visible default selections", async () => {
+ const { update, field } = await fixture();
+ const [changed] = await db
+ .update(schema.customFieldDefinitionTable)
+ .set({ defaultValue: '["Alice","Bob"]' })
+ .where(eq(schema.customFieldDefinitionTable.id, field.id))
+ .returning();
+ const response = await update({
+ updatedAt: changed.updatedAt.toISOString(),
+ options: [
+ { originalValue: "Alice", value: "Alice", hidden: true },
+ { originalValue: "Bob", value: "Bob" },
+ ],
+ });
+ expect(await response.json()).toMatchObject({
+ defaultValue: '["Bob"]',
+ hiddenOptions: ["Alice"],
+ });
+ });
+});