Commit 7cdae14
Fix IsJsonCollectionColumn matching nested OwnsMany inside OwnsOne
The IsJsonCollectionColumn check was incorrectly matching a nested
OwnsMany inside an OwnsOne reference, because the nested entity's
GetContainerColumnName() returns the root JSON column name and its
ownership has IsUnique: false. This caused Convert_string_column_to_
a_json_column_containing_required_reference to fail with '[]' instead
of '{}'.
Fix: only consider root-level entity mappings whose principal is not
itself mapped to JSON. Added a regression test for this case.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>1 parent 4823084 commit 7cdae14
2 files changed
Lines changed: 55 additions & 1 deletion
File tree
- src/EFCore.Relational/Migrations/Internal
- test/EFCore.Relational.Tests/Migrations/Internal
Lines changed: 2 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1292 | 1292 | | |
1293 | 1293 | | |
1294 | 1294 | | |
1295 | | - | |
| 1295 | + | |
| 1296 | + | |
1296 | 1297 | | |
1297 | 1298 | | |
1298 | 1299 | | |
| |||
Lines changed: 53 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10102 | 10102 | | |
10103 | 10103 | | |
10104 | 10104 | | |
| 10105 | + | |
| 10106 | + | |
| 10107 | + | |
| 10108 | + | |
| 10109 | + | |
| 10110 | + | |
| 10111 | + | |
| 10112 | + | |
| 10113 | + | |
| 10114 | + | |
| 10115 | + | |
| 10116 | + | |
| 10117 | + | |
| 10118 | + | |
| 10119 | + | |
| 10120 | + | |
| 10121 | + | |
| 10122 | + | |
| 10123 | + | |
| 10124 | + | |
| 10125 | + | |
| 10126 | + | |
| 10127 | + | |
| 10128 | + | |
| 10129 | + | |
| 10130 | + | |
| 10131 | + | |
| 10132 | + | |
| 10133 | + | |
| 10134 | + | |
| 10135 | + | |
| 10136 | + | |
| 10137 | + | |
| 10138 | + | |
| 10139 | + | |
| 10140 | + | |
| 10141 | + | |
| 10142 | + | |
| 10143 | + | |
| 10144 | + | |
| 10145 | + | |
| 10146 | + | |
| 10147 | + | |
| 10148 | + | |
| 10149 | + | |
| 10150 | + | |
| 10151 | + | |
| 10152 | + | |
| 10153 | + | |
| 10154 | + | |
| 10155 | + | |
| 10156 | + | |
| 10157 | + | |
10105 | 10158 | | |
10106 | 10159 | | |
10107 | 10160 | | |
| |||
0 commit comments