mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-05-20 02:05:21 -04:00
fix(history-entry): 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
d1c3058655
commit
a626ace4b9
7 changed files with 60 additions and 55 deletions
|
@ -313,7 +313,7 @@ describe('NotesService', () => {
|
|||
expect(revisions).toHaveLength(1);
|
||||
expect(revisions[0].content).toEqual(content);
|
||||
expect(await newNote.historyEntries).toHaveLength(1);
|
||||
expect((await newNote.historyEntries)[0].user).toEqual(user);
|
||||
expect(await (await newNote.historyEntries)[0].user).toEqual(user);
|
||||
expect(await newNote.userPermissions).toHaveLength(0);
|
||||
expect(await newNote.groupPermissions).toHaveLength(0);
|
||||
expect(await newNote.tags).toHaveLength(0);
|
||||
|
@ -338,7 +338,7 @@ describe('NotesService', () => {
|
|||
expect(revisions).toHaveLength(1);
|
||||
expect(revisions[0].content).toEqual(content);
|
||||
expect(await newNote.historyEntries).toHaveLength(1);
|
||||
expect((await newNote.historyEntries)[0].user).toEqual(user);
|
||||
expect(await (await newNote.historyEntries)[0].user).toEqual(user);
|
||||
expect(await newNote.userPermissions).toHaveLength(0);
|
||||
expect(await newNote.groupPermissions).toHaveLength(0);
|
||||
expect(await newNote.tags).toHaveLength(0);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue