--- title: "freeform project_id BIGINT 对齐 projects.id" task_id: "freeform-project-id-bigint-2026-09-22" status: done created: 2026-09-22 owner: Cursor task_type: implementation branch: feature/freeform-project-id-bigint-2026-09-22 worktree: .worktrees/freeform-project-id-bigint-2026-09-22 write_scope: ["deploy/postgres/goose", "internal/freedoc", "internal/server", ".doc"] allowed_environments: ["dev"] mutex: "deploy/postgres/goose + freeform" --- # freeform project_id BIGINT ## 问题 `POST /api/v1/freeform-documents` 在雪花 `project_id`(>int4 max)时 pgx 编码失败(OID 23),阻塞 UI-11 附件注册。 ## 修复 - goose `00063`:`freeform_documents.project_id` → BIGINT - Go `ProjectID`/`ListDocuments` → int64;list query 用 `ParseInt` - 活库已手工 ALTER(schema 仍报 61);合入后 goose 幂等加固 ## 验证 - `go test ./internal/freedoc/ -short` PASS(含 snowflake 回归) - 活库 column = bigint