Skip to content

feat: 建物自体を表すfacilityノードタイプを追加し、UUID形式のnode_id投入に対応 - #3

Merged
shikasan2127 merged 6 commits into
mainfrom
feat/facility-node-and-seed-fix
Oct 1, 2026
Merged

shikasan2127 merged 6 commits into
mainfrom
feat/facility-node-and-seed-fix

Conversation

@shikasan2127

Copy link
Copy Markdown
Member

Summary

  • nodes.node_typeに建物自体を表すfacilityを追加(entrance/facility/door/roadを許容)
  • building_idにDEFAULT -1(建物に属さないノードの統一sentinel)、floorにDEFAULT 1を設定
  • seedのnode_id/edge参照カラムにUUID(ハイフン区切り)を使えるよう、CHECK制約の正規表現を^[a-z0-9_]+$から^[a-z0-9_-]+$に緩和

Test plan

  • go build ./...
  • go vet ./...
  • golangci-lint run ./...(0 issues)
  • 実DB環境でdb/seeds配下のnodes.csv/edges.csv投入が成功することを確認

🤖 Generated with Claude Code

shikasan2127 and others added 6 commits September 25, 2026 18:00
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
seed CSV(db/seeds/nodes.csv, edges.csv)のnode_idにUUID(ハイフン区切り)
を採用したが、chk_node_id_format等の正規表現が^[a-z0-9_]+$のままで
ハイフンを許可しておらずINSERTが失敗していたため、
^[a-z0-9_-]+$に緩和した。

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
PR #1(main-devの統合)とPR #2(entrance/facility最近傍選定修正)を反映。

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
building_idがNULLの行でis_indoorがNULL(false扱い)として誤って屋外判定
されないよう、COALESCE(n.building_id, -1)で明示的にデフォルト値を補完。
併せてmodel.Node.BuildingIDがDB上NOT NULL(-1がsentinel)でありnilには
ならないことをコメントで明記。

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@shikasan2127
shikasan2127 merged commit 0a49208 into main Oct 1, 2026
3 checks passed
@shikasan2127
shikasan2127 deleted the feat/facility-node-and-seed-fix branch October 1, 2026 00:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant