mirror of
https://github.com/ArthurDanjou/artdanj-api.git
synced 2026-01-14 12:14:33 +01:00
22 lines
558 B
TypeScript
22 lines
558 B
TypeScript
import { DateTime } from 'luxon'
|
|
import {BaseModel, BelongsTo, belongsTo, column} from '@ioc:Adonis/Lucid/Orm'
|
|
import Translation from "App/Models/Translation";
|
|
|
|
export default class Tag extends BaseModel {
|
|
@column({ isPrimary: true })
|
|
public id: number
|
|
|
|
@belongsTo(() => Translation, {
|
|
foreignKey: 'labelId'
|
|
})
|
|
public label: BelongsTo<typeof Translation>
|
|
|
|
public labelId: number
|
|
|
|
@column.dateTime({ autoCreate: true })
|
|
public createdAt: DateTime
|
|
|
|
@column.dateTime({ autoCreate: true, autoUpdate: true })
|
|
public updatedAt: DateTime
|
|
}
|