Skip to content

fix(database): prevent infinite loop when creating a model with a HasOne relationship#1962

Open
nunntom wants to merge 4 commits intotempestphp:3.xfrom
nunntom:hasone-creation-infinite-loop
Open

fix(database): prevent infinite loop when creating a model with a HasOne relationship#1962
nunntom wants to merge 4 commits intotempestphp:3.xfrom
nunntom:hasone-creation-infinite-loop

Conversation

@nunntom
Copy link

@nunntom nunntom commented Feb 12, 2026

When creating a model along with a child with a HasOne relationship, you get an infinite loop:
#1961

  • Added a failing (more like hanging) test.
  • Excluded the foreign key property from the child model query data.

@brendt
Copy link
Member

brendt commented Feb 13, 2026

Thanks! This seems to break Tests\Tempest\Integration\Database\Builder\IsDatabaseModelTest::test_create_with_hasone_relation, any ideas?

@nunntom
Copy link
Author

nunntom commented Feb 13, 2026

That was the test I added! Hopefully should be fixed now. Local tests were running with sqlite which doesn't care about foreign key tables not being present on table creation.

@nunntom nunntom changed the title Fix infinite loop when creating a model with a HasOne relationship fix(database): prevent infinite loop when creating a model with a HasOne relationship Feb 16, 2026
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.

2 participants