add Skill

This commit is contained in:
2021-08-14 12:25:38 +02:00
parent f9098be315
commit a5062cc854
7 changed files with 139 additions and 1 deletions

23
app/Models/Skill.ts Normal file
View File

@@ -0,0 +1,23 @@
import { DateTime } from 'luxon'
import {BaseModel, BelongsTo, belongsTo, column} from '@ioc:Adonis/Lucid/Orm'
import File from "App/Models/File";
export default class Skill extends BaseModel {
@column({ isPrimary: true })
public id: number
@column()
public name: string
@belongsTo(() => File)
public file: BelongsTo<typeof File>
@column()
public fileId: number
@column.dateTime({ autoCreate: true })
public createdAt: DateTime
@column.dateTime({ autoCreate: true, autoUpdate: true })
public updatedAt: DateTime
}