Add PostColor and content

This commit is contained in:
2021-08-28 22:36:38 +02:00
parent 48552f0ccf
commit 8f81926447
12 changed files with 156 additions and 1 deletions

View File

@@ -3,6 +3,7 @@ import {BaseModel, BelongsTo, belongsTo, column, manyToMany, ManyToMany} from '@
import Tag from "App/Models/Tag";
import Translation from "App/Models/Translation";
import File from "App/Models/File";
import PostColor from "App/Models/PostColor";
export default class Post extends BaseModel {
@column({ isPrimary: true })
@@ -49,6 +50,14 @@ export default class Post extends BaseModel {
@column()
public contentId: number
@belongsTo(() => PostColor, {
foreignKey: 'postColorId'
})
public color: BelongsTo<typeof PostColor>
@column()
public postColorId: number
@column()
public readingTime: number