Fix undefined pk (#8260)

Signed-off-by: Alexandre Bodin <bodin.alex@gmail.com>
This commit is contained in:
Alexandre BODIN 2020-10-09 17:08:37 +02:00 committed by GitHub
parent 7545f9501a
commit b91059a522
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 1 deletions

View File

@ -10,6 +10,7 @@ module.exports = async ({ ORM, loadedModel, definition, connection, model }) =>
if (!definitionDidChange) {
return;
}
const draftAndPublishMigrationWay = await getDraftAndPublishMigrationWay({ definition, ORM });
if (draftAndPublishMigrationWay === 'disable') {
await migrateDraftAndPublish({ definition, ORM, way: 'disable' });

View File

@ -237,7 +237,7 @@ module.exports = async ({ models, target }, ctx, { selfFinalize = false } = {})
// Force singular foreign key
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.
details.isVirtual = true;