Skip to content

Updated the moqui.server.Visit relationship type from one to one-nofk to remove the foreign key constraint on the Visit entity.#653

Open
dixitdeepak wants to merge 1 commit into
moqui:masterfrom
dixitdeepak:visit-relationship-one-no-fk
Open

Updated the moqui.server.Visit relationship type from one to one-nofk to remove the foreign key constraint on the Visit entity.#653
dixitdeepak wants to merge 1 commit into
moqui:masterfrom
dixitdeepak:visit-relationship-one-no-fk

Conversation

@dixitdeepak

@dixitdeepak dixitdeepak commented Mar 10, 2025

Copy link
Copy Markdown
Contributor

Motivation

The one relationship type generates a database-level foreign key (FK) constraint, which causes issues during visit data purging. When visit/visitor records are purged, the FK constraint prevents deletion of related records, leading to constraint violations.

This aligns with the existing pattern used in ArtifactHit, which already uses one-nofk for its Visit relationship — reinforcing that FK constraints are not appropriate for transient session/visit data.

  • Visit and visitor data is transient/purgeable by nature — maintaining a hard FK reference defeats the purpose of data purging
  • Consistent with how ArtifactHit handles the same relationship
  • No functional impact on query behavior; the logical relationship is preserved without the DB constraint
  • Enables clean purging of visit/visitor data without constraint violations

@dixitdeepak dixitdeepak changed the title Updated Visit entity relationship type from one to one-nofk to preven… Updated the moqui.server.Visit relationship type from one to one-nofk to remove the foreign key constraint on the Visit entity. Jun 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant