mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-05-13 06:34:39 -04:00
fix(permissions): remove composite primary keys
TypeORM promises to support composite primary keys, but that does not work in reality. This replaces the composite key used in the permission entities with a single generated primary key and a unique index on the relation columns. See https://github.com/typeorm/typeorm/issues/8513 Signed-off-by: David Mehren <git@herrmehren.de>
This commit is contained in:
parent
2689f9f3dc
commit
d1c3058655
7 changed files with 199 additions and 143 deletions
|
@ -211,9 +211,9 @@ describe('Notes', () => {
|
|||
expect((await updatedNote.userPermissions)[0].canEdit).toEqual(
|
||||
updateNotePermission.sharedToUsers[0].canEdit,
|
||||
);
|
||||
expect((await updatedNote.userPermissions)[0].user.username).toEqual(
|
||||
user.username,
|
||||
);
|
||||
expect(
|
||||
(await (await updatedNote.userPermissions)[0].user).username,
|
||||
).toEqual(user.username);
|
||||
expect(await updatedNote.groupPermissions).toHaveLength(0);
|
||||
await request(testSetup.app.getHttpServer())
|
||||
.delete('/api/v2/notes/test3')
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue