adminjs-prisma
adminjs-prisma copied to clipboard
Prisma v7 compatibility
It looks like this is not yet compatible with Prisma v7. There are some nice features in v7 that would be great to take advantage of.
https://www.prisma.io/docs/orm/more/upgrade-guides/upgrading-versions/upgrading-to-prisma-7
What happens if you upgrade to Prisma 7? We're on 6.7, but switched to the new queryCompiler and started getting the following error:
Error: Resource: "<model>" does not have an id property
Looking at Property.js#isId and Resource.js#prepareProperties, it looks like isId is no longer set in Prisma's new modeling.
We got around this by locally patching adminjs/prisma to turn:
const property = new Property(
field,
Object.keys(memo).length,
this.enums,
);
into
const property = new Property(
{ ...field, isId: field.name === 'id'},
Object.keys(memo).length,
this.enums,
);
and this seems to have fixed it for now