From a76cfd036ce3a00eb1d22b9f79ea3450d3262ae9 Mon Sep 17 00:00:00 2001 From: Claude Date: Thu, 18 Jun 2026 22:14:44 +0000 Subject: [PATCH] fix(kanban): qualify task_buckets table with configured schema in upsert The native upsert uses raw SQL, which bypasses xorm's bean-based table-name handling and would target the default schema instead of a configured postgres database.schema. Resolve the schema-qualified table name via the engine so bucket moves keep working on schema-configured deployments. Co-Authored-By: Claude Opus 4.8 Claude-Session: https://claude.ai/code/session_01JK7JwuvjhcsNf5d5fUopeY --- pkg/models/kanban_task_bucket.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pkg/models/kanban_task_bucket.go b/pkg/models/kanban_task_bucket.go index 90e48d70f..cd58e6928 100644 --- a/pkg/models/kanban_task_bucket.go +++ b/pkg/models/kanban_task_bucket.go @@ -68,7 +68,10 @@ func (b *TaskBucket) upsert(s *xorm.Session) (err error) { onConflict = "ON DUPLICATE KEY UPDATE bucket_id = VALUES(bucket_id)" } - query := "INSERT INTO task_buckets (task_id, project_view_id, bucket_id) VALUES (?, ?, ?) " + onConflict + // Raw SQL bypasses xorm's bean-based table-name handling, so qualify the + // table ourselves to honor a configured postgres schema (database.schema). + table := s.Engine().TableName(b, true) + query := "INSERT INTO " + table + " (task_id, project_view_id, bucket_id) VALUES (?, ?, ?) " + onConflict _, err = s.Exec(query, b.TaskID, b.ProjectViewID, b.BucketID) return }