Skip to content

Commit 7971a1d

Browse files
committed
fix: avoid reference unused enums in generated policy code
1 parent 04184b9 commit 7971a1d

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
import { loadSchema } from '@zenstackhq/testtools';
2+
3+
describe('issue 1835', () => {
4+
it('regression', async () => {
5+
await loadSchema(
6+
`
7+
enum Enum {
8+
SOME_VALUE
9+
ANOTHER_VALUE
10+
}
11+
12+
model Model {
13+
id String @id @default(cuid())
14+
value Enum
15+
@@ignore
16+
}
17+
18+
model AnotherModel {
19+
id String @id @default(cuid())
20+
}
21+
`,
22+
{
23+
provider: 'postgresql',
24+
pushDb: false,
25+
}
26+
);
27+
});
28+
});

0 commit comments

Comments
 (0)