feat(properties): add parent_id for sub-property hierarchy
Phase 1 of the parent/child rollup feature. Self-FK on properties with ON DELETE RESTRICT, plus a CHECK that blocks self-reference at the DB level. Service-layer helpers (getDescendantIds, getAncestorIds, assertNoCycle) walk the tree via recursive CTEs and guard against cycles and cross-company parents. softDeleteProperty now refuses to delete a property with live children. No UI yet — readers and roll-up routes land in Phase 2. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in: