mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-02-02 13:41:22 +00:00
Add AuthorColor entity
Signed-off-by: David Mehren <git@herrmehren.de>
This commit is contained in:
parent
40034a4a84
commit
ba9d7a6572
2 changed files with 25 additions and 1 deletions
23
src/notes/author-color.entity.ts
Normal file
23
src/notes/author-color.entity.ts
Normal file
|
@ -0,0 +1,23 @@
|
|||
import { Column, Entity, ManyToOne } from 'typeorm/index';
|
||||
import { User } from '../users/user.entity';
|
||||
import { Note } from './note.entity';
|
||||
|
||||
@Entity()
|
||||
export class AuthorColor {
|
||||
@ManyToOne(
|
||||
_ => Note,
|
||||
note => note.authorColors,
|
||||
{
|
||||
primary: true,
|
||||
},
|
||||
)
|
||||
note: Note;
|
||||
|
||||
@ManyToOne(_ => User, {
|
||||
primary: true,
|
||||
})
|
||||
user: User;
|
||||
|
||||
@Column()
|
||||
color: string;
|
||||
}
|
|
@ -1,10 +1,11 @@
|
|||
import { Module } from '@nestjs/common';
|
||||
import { TypeOrmModule } from '@nestjs/typeorm';
|
||||
import { AuthorColor } from './author-color.entity';
|
||||
import { Note } from './note.entity';
|
||||
import { NotesService } from './notes.service';
|
||||
|
||||
@Module({
|
||||
imports: [TypeOrmModule.forFeature([Note])],
|
||||
imports: [TypeOrmModule.forFeature([Note, AuthorColor])],
|
||||
controllers: [],
|
||||
providers: [NotesService],
|
||||
exports: [NotesService],
|
||||
|
|
Loading…
Reference in a new issue