This PR adds the functionality to check multiple annotations for the bulk_create_foreign_key property to use for the bulk create foreign key functionality in recordedit app. This previous PR added the functionality when certain heuristics were met (which included limiting this to tables with only 2 foreign keys). This annotation allows for a table with any number of foreign keys to use this feature provided the model is annotated according to the spec.
Tests that are included in this PR are as follows:
for tables with 3 foreign keys, annotations are defined that use 1 of those foreign keys when coming from "main" as the prefill
visible columns annotation with display property set on main <- association fk column source definition that points to the "third" table instead of the "leaf" table
foreign key annotation with display property property set on main <- association fk column source definition that points to the "third" table instead of the "leaf" table
table display annotation with bulk_create_foreign_key_candidates set on association table that points to "third" table instead of "leaf" table
has ['leaf constraint name', 'third constraint name'] but leaf is not in visible columns so "third" is used instead
for tables with 2 foreign keys, annotations are defined to turn off the feature for both foreign keys or just 1 foreign key
display annotation on table with false set to turn off feature for main prefill AND leaf prefill
fk annotation on main < association fk with false set to turn off the feature for main prefill
leaf prefill should not check any annotation and use the heuristics for the table
visible columns entry from main < association fk with false set to turn off the feature for main prefill
leaf prefill should not check any annotation and use the heuristics for the table
More details about these annotation changes can be found in the chaise issue.
This PR adds the functionality to check multiple annotations for the
bulk_create_foreign_key
property to use for the bulk create foreign key functionality in recordedit app. This previous PR added the functionality when certain heuristics were met (which included limiting this to tables with only 2 foreign keys). This annotation allows for a table with any number of foreign keys to use this feature provided the model is annotated according to the spec.Tests that are included in this PR are as follows:
main <- association
fk column source definition that points to the "third" table instead of the "leaf" tablemain <- association
fk column source definition that points to the "third" table instead of the "leaf" tablebulk_create_foreign_key_candidates
set on association table that points to "third" table instead of "leaf" tablemain < association
fk with false set to turn off the feature for main prefillmain < association
fk with false set to turn off the feature for main prefillMore details about these annotation changes can be found in the chaise issue.