many-to-many nullable columns with through#852
many-to-many nullable columns with through#852nikelborm wants to merge 2 commits intoormar-orm:masterfrom
Conversation
77fae53 to
4b7de5a
Compare
| is_through_relation_column_nullable = kwargs.pop("is_through_relation_column_nullable", None) | ||
| is_through_reverse_relation_column_nullable = kwargs.pop("is_through_reverse_relation_column_nullable", None) |
There was a problem hiding this comment.
Can you rename it to shorter names: through_relation_nullable and through_reverse_relation_nullable
| ) | ||
| create_and_append_m2m_fk( | ||
| model=model_field.owner, model_field=model_field, field_name=child_name | ||
| model=model_field.owner, model_field=model_field, field_name=child_name, nullable=model_field.is_through_relation_column_nullable, |
There was a problem hiding this comment.
Can you add missing tests for setting that column settings nullable/ not nullable and different expected behavior?
|
Sorry for the long review time! |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #852 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 204 204
Lines 14845 14847 +2
=========================================
+ Hits 14845 14847 +2
|
CodSpeed Performance ReportMerging #852 will degrade performances by 12.33%Comparing Summary
Benchmarks breakdown
|
|
Hi @collerek |
such code:
cause such migration:
Here
ticker_idandticker_collection_idare nullable by default, and there is no built-in way to set them non nullable.I tried to set
sql_nullableandnullablein arguments oformar.ManyToManybut looks like it affects only typing information.So then I added these two parameters, that will allow to override nullability of both
throughcolumns.