Skip to content

Commit af49333

Browse files
committed
fix: make ignore behave it does in prisma with no index models
1 parent fbe1aad commit af49333

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

packages/language/src/validators/datamodel-validator.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,12 +48,14 @@ export default class DataModelValidator implements AstValidator<DataModel> {
4848
const uniqueFields = allFields.filter((f) => f.attributes.find((attr) => attr.decl.ref?.name === '@unique'));
4949
const modelLevelIds = getModelIdFields(dm);
5050
const modelUniqueFields = getModelUniqueFields(dm);
51+
const ignore = hasAttribute(dm, '@@ignore');
5152

5253
if (
5354
idFields.length === 0 &&
5455
modelLevelIds.length === 0 &&
5556
uniqueFields.length === 0 &&
56-
modelUniqueFields.length === 0
57+
modelUniqueFields.length === 0 &&
58+
!ignore
5759
) {
5860
accept(
5961
'error',

0 commit comments

Comments
 (0)