Add tags pivot in projects

This commit is contained in:
2021-08-16 23:30:32 +02:00
parent 5c3dd37758
commit 2931be07bb
4 changed files with 17 additions and 9 deletions

View File

@@ -19,11 +19,13 @@ export default class Project extends BaseModel {
@column()
public url: string
@belongsTo(() => File)
public file: BelongsTo<typeof File>
@belongsTo(() => File, {
foreignKey: 'coverId'
})
public cover: BelongsTo<typeof File>
@column()
public fileId: number
public coverId: number
@manyToMany(() => Tag)
public tags: ManyToMany<typeof Tag>