mirror of
https://github.com/strapi/strapi.git
synced 2025-07-21 07:57:45 +00:00
make strict connect explicit when inserting relation
This commit is contained in:
parent
51cd3ddc85
commit
cf01fb8db6
@ -586,7 +586,12 @@ const createEntityManager = (db) => {
|
|||||||
});
|
});
|
||||||
} else if (cleanRelationData.connect && hasOrderColumn(attribute)) {
|
} else if (cleanRelationData.connect && hasOrderColumn(attribute)) {
|
||||||
// use position attributes to calculate order
|
// use position attributes to calculate order
|
||||||
const orderMap = relationsOrderer([], inverseJoinColumn.name, joinTable.orderColumnName)
|
const orderMap = relationsOrderer(
|
||||||
|
[],
|
||||||
|
inverseJoinColumn.name,
|
||||||
|
joinTable.orderColumnName,
|
||||||
|
true // Always make an strict connect when inserting
|
||||||
|
)
|
||||||
.connect(relsToAdd)
|
.connect(relsToAdd)
|
||||||
.get()
|
.get()
|
||||||
// set the order based on the order of the ids
|
// set the order based on the order of the ids
|
||||||
|
Loading…
x
Reference in New Issue
Block a user