Skip to content

Commit

Permalink
clean up workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
ymc9 committed Dec 16, 2024
1 parent 8764735 commit 469b26e
Show file tree
Hide file tree
Showing 3 changed files with 71 additions and 124 deletions.
58 changes: 0 additions & 58 deletions .github/workflows/management-changelog.yml

This file was deleted.

66 changes: 0 additions & 66 deletions .github/workflows/security-defender-for-devops.yml

This file was deleted.

71 changes: 71 additions & 0 deletions tests/regression/tests/issue-1898.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
import { loadSchema } from '@zenstackhq/testtools';

describe('issue 1898', () => {
it('regression', async () => {
const { enhance, prisma } = await loadSchema(
`
model Role {
id Int @id @default(autoincrement())
name String @unique
permissions Permission[]
foos Foo[]
deletable Boolean @default(true)
@@allow('all', true)
}
model Permission {
id Int @id @default(autoincrement())
name String
roleId Int
role Role @relation(fields: [roleId], references: [id], onDelete: Cascade)
@@allow('all', true)
}
model Foo {
id Int @id @default(autoincrement())
name String
roleId Int
role Role @relation(fields: [roleId], references: [id])
}
`,
{ logPrismaQuery: true, prismaClientOptions: { log: ['query', 'info'] } }
);

const db = enhance();

const role = await prisma.role.create({
data: {
name: 'regular',
permissions: {
create: [
{ id: 1, name: 'read' },
{ id: 2, name: 'write' },
],
},
},
});

const updatedRole = await prisma.role.update({
where: { id: role.id },
data: {
name: 'admin',
foos: {
create: { name: 'foo1' },
},
permissions: {
deleteMany: {
roleId: role.id,
},
create: { id: 3, name: 'delete' },
update: { where: { id: 3 }, data: { name: 'delete1' } },
},
deletable: false,
},
include: { permissions: true },
});

console.log(updatedRole);
});
});

0 comments on commit 469b26e

Please sign in to comment.