NoteEntity: Formatting fixes

Signed-off-by: David Mehren <git@herrmehren.de>
This commit is contained in:
David Mehren 2020-09-19 15:57:57 +02:00
parent 4ff60b162e
commit 8c050b3c2f
No known key found for this signature in database
GPG key ID: 185982BA4C42B7C3

View file

@ -16,51 +16,43 @@ import { AuthorColor } from './author-color.entity';
export class Note { export class Note {
@PrimaryGeneratedColumn('uuid') @PrimaryGeneratedColumn('uuid')
id: string; id: string;
@Column({ @Column({
nullable: false, nullable: false,
unique: true, unique: true,
}) })
shortid: string; shortid: string;
@Column({ @Column({
unique: true, unique: true,
nullable: true, nullable: true,
}) })
alias: string; alias: string;
@OneToMany( @OneToMany(
_ => NoteGroupPermission, _ => NoteGroupPermission,
groupPermission => groupPermission.note, groupPermission => groupPermission.note,
) )
groupPermissions: NoteGroupPermission[]; groupPermissions: NoteGroupPermission[];
@OneToMany( @OneToMany(
_ => NoteUserPermission, _ => NoteUserPermission,
userPermission => userPermission.note, userPermission => userPermission.note,
) )
userPermissions: NoteUserPermission[]; userPermissions: NoteUserPermission[];
@Column({ @Column({
nullable: false, nullable: false,
default: 0, default: 0,
}) })
viewcount: number; viewcount: number;
@ManyToOne( @ManyToOne(
_ => User, _ => User,
user => user.ownedNotes, user => user.ownedNotes,
{ onDelete: 'CASCADE' }, { onDelete: 'CASCADE' },
) )
owner: User; owner: User;
@OneToMany( @OneToMany(
_ => Revision, _ => Revision,
revision => revision.note, revision => revision.note,
{ cascade: true }, { cascade: true },
) )
revisions: Revision[]; revisions: Revision[];
@OneToMany( @OneToMany(
_ => AuthorColor, _ => AuthorColor,
authorColor => authorColor.note, authorColor => authorColor.note,