mirror of
https://github.com/ArthurDanjou/artdanj-api.git
synced 2026-01-14 12:14:33 +01:00
add Skill
This commit is contained in:
23
app/Models/Skill.ts
Normal file
23
app/Models/Skill.ts
Normal 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
|
||||
}
|
||||
Reference in New Issue
Block a user