Commit 2252534
fix(odata-import): skip existing nav associations on re-import (no duplicates)
Re-importing external entities (or running an import script twice) created a
numerically-suffixed duplicate of every OData navigation association on each
run — People's Friends/BestFriend became Friends/Friends2/Friends3, etc. A full
TripPin re-import inflated the module from 8 nav associations to 25.
createNavigationAssociations only ensured association-name *uniqueness*: when a
nav property's association already existed, uniqueAssocName appended a suffix
and created a new one, rather than recognizing it as already-imported. The
modelsdk read doesn't preserve RemoteParentNavigationProperty, so the dedup
can't rely on it alone.
Skip a nav property when the parent entity already has an association for it —
matched by RemoteParentNavigationProperty when available (legacy read) and by
the natural association name (== nav-property name) as the engine-agnostic
fallback. Verified end-to-end: a triple TripPin import now yields 8 nav
associations (was 25), and re-imports create 0.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>1 parent ab625c9 commit 2252534
2 files changed
Lines changed: 75 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
954 | 954 | | |
955 | 955 | | |
956 | 956 | | |
957 | | - | |
| 957 | + | |
| 958 | + | |
| 959 | + | |
| 960 | + | |
| 961 | + | |
| 962 | + | |
| 963 | + | |
958 | 964 | | |
| 965 | + | |
959 | 966 | | |
960 | 967 | | |
961 | 968 | | |
962 | 969 | | |
963 | 970 | | |
| 971 | + | |
| 972 | + | |
| 973 | + | |
964 | 974 | | |
965 | 975 | | |
966 | 976 | | |
| |||
1004 | 1014 | | |
1005 | 1015 | | |
1006 | 1016 | | |
| 1017 | + | |
| 1018 | + | |
| 1019 | + | |
| 1020 | + | |
| 1021 | + | |
| 1022 | + | |
| 1023 | + | |
| 1024 | + | |
| 1025 | + | |
| 1026 | + | |
| 1027 | + | |
1007 | 1028 | | |
1008 | 1029 | | |
1009 | 1030 | | |
| |||
1059 | 1080 | | |
1060 | 1081 | | |
1061 | 1082 | | |
| 1083 | + | |
1062 | 1084 | | |
1063 | 1085 | | |
1064 | 1086 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| 8 | + | |
8 | 9 | | |
| 10 | + | |
9 | 11 | | |
10 | 12 | | |
11 | 13 | | |
| |||
80 | 82 | | |
81 | 83 | | |
82 | 84 | | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
0 commit comments