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 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JK7JwuvjhcsNf5d5fUopeY
This commit is contained in:
parent
de674b5a2c
commit
a76cfd036c
|
|
@ -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
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue