page_links FK on-delete behavior decision #21
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Context
The
page_linkstable FKs (source_page_id,target_page_id) currently have noonDeletebehavior. PostgreSQL defaults toNO ACTION, which means any page that participates in an edge cannot be deleted without first removing its edges.For v0.1 this is a non-issue because we have no delete operations on
pages. But the moment we add deletion (admin tooling, GDPR-style URL removal, instance withdrawal cascades), this constraint will bite.Decision needed
Pick one:
cascadeOnDelete()— deleting a page also deletes its inbound and outbound edges. Lossy but simple. Right semantic if "page is gone, the citation graph forgets it."nullOnDelete()— deleting a page leaves orphan edges with NULL endpoints. Requires nullable FK columns (currently NOT NULL). Enables "we know the edge existed but the page is gone" semantics. Almost certainly the wrong call for our citation graph.Recommended:
cascadeOnDelete()on both columns. Edges follow page lifecycle.Acceptance criteria
page_linksalready exists).