mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-05-18 09:04:44 -04:00
refactor: adapt for typeorm 0.3
Signed-off-by: David Mehren <git@herrmehren.de>
This commit is contained in:
parent
a07b5f54d1
commit
c4975e4783
21 changed files with 131 additions and 69 deletions
|
@ -3,7 +3,7 @@
|
|||
*
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
import { Column, Entity, ManyToOne } from 'typeorm';
|
||||
import { Column, Entity, ManyToOne, PrimaryColumn } from 'typeorm';
|
||||
|
||||
import { Group } from '../groups/group.entity';
|
||||
import { Note } from '../notes/note.entity';
|
||||
|
@ -17,14 +17,18 @@ export class NoteGroupPermission {
|
|||
* See https://github.com/typeorm/typeorm/issues/6908
|
||||
*/
|
||||
|
||||
@PrimaryColumn()
|
||||
groupId: number;
|
||||
|
||||
@ManyToOne((_) => Group, {
|
||||
primary: true,
|
||||
onDelete: 'CASCADE', // This deletes the NoteGroupPermission, when the associated Group is deleted
|
||||
})
|
||||
group: Group;
|
||||
|
||||
@PrimaryColumn()
|
||||
noteId: string;
|
||||
|
||||
@ManyToOne((_) => Note, (note) => note.groupPermissions, {
|
||||
primary: true,
|
||||
onDelete: 'CASCADE', // This deletes the NoteGroupPermission, when the associated Note is deleted
|
||||
})
|
||||
note: Note;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue