fix(sqla_factory): changed default value for __set_foreign_keys__ attr.
Description
- turned
__set_foreign_keys__attribute default value toFalse - added an appropriate part of the docs
Prerequisites for this changing
Thanks to @adhtruong for https://github.com/litestar-org/polyfactory/issues/624#issuecomment-2591171953
...
__set_foreign_keys__is breaking behaviour.
and
Note a foreign key may be present without a relationship in ORM definition.
My intention was:
-
avoiding redundant factory work Although a foreign key can be used without a relationship, it is most often paired with a relationship. So a particular factory will be doing sort of a double work because creating foreign field data will be overridden by a relationship.
-
consistency in the field logic with
__set_relationships__and__set_association_proxy__~~(if the last one is added in the future)~~
Closes
- Closes #624
Documentation preview will be available shortly at https://litestar-org.github.io/polyfactory-docs-preview/632
Closing in favour of adjusting as part of v3 to avoid backwards breaking change