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:
David Mehren 2022-09-18 18:59:10 +02:00
parent d1c3058655
commit a626ace4b9
7 changed files with 60 additions and 55 deletions

View file

@ -118,7 +118,7 @@ describe('Me', () => {
let theEntry: HistoryEntryDto;
for (const entry of history) {
if (
(await entry.note.aliases).find(
(await (await entry.note).aliases).find(
(element) => element.name === noteName,
)
) {
@ -147,7 +147,7 @@ describe('Me', () => {
const history = await testSetup.historyService.getEntriesByUser(user);
for (const entry of history) {
if (
(await entry.note.aliases).find(
(await (await entry.note).aliases).find(
(element) => element.name === noteName,
)
) {