mirror of
https://github.com/strapi/strapi.git
synced 2025-09-26 00:39:49 +00:00
Fix undefined pk (#8260)
Signed-off-by: Alexandre Bodin <bodin.alex@gmail.com>
This commit is contained in:
parent
7545f9501a
commit
b91059a522
@ -10,6 +10,7 @@ module.exports = async ({ ORM, loadedModel, definition, connection, model }) =>
|
|||||||
if (!definitionDidChange) {
|
if (!definitionDidChange) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const draftAndPublishMigrationWay = await getDraftAndPublishMigrationWay({ definition, ORM });
|
const draftAndPublishMigrationWay = await getDraftAndPublishMigrationWay({ definition, ORM });
|
||||||
if (draftAndPublishMigrationWay === 'disable') {
|
if (draftAndPublishMigrationWay === 'disable') {
|
||||||
await migrateDraftAndPublish({ definition, ORM, way: 'disable' });
|
await migrateDraftAndPublish({ definition, ORM, way: 'disable' });
|
||||||
|
@ -237,7 +237,7 @@ module.exports = async ({ models, target }, ctx, { selfFinalize = false } = {})
|
|||||||
|
|
||||||
// Force singular foreign key
|
// Force singular foreign key
|
||||||
details.attribute = singular(details.collection);
|
details.attribute = singular(details.collection);
|
||||||
details.column = targetModel.primaryKey;
|
details.column = 'id';
|
||||||
|
|
||||||
// Set this info to be able to see if this field is a real database's field.
|
// Set this info to be able to see if this field is a real database's field.
|
||||||
details.isVirtual = true;
|
details.isVirtual = true;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user