27 lines
606 B
TypeScript
27 lines
606 B
TypeScript
import { DateTime } from 'luxon'
|
|
import { BaseModel, belongsTo, BelongsTo, column } from '@ioc:Adonis/Lucid/Orm'
|
|
import Employee from 'App/Models/Employee'
|
|
|
|
export default class Setting extends BaseModel {
|
|
@column({ isPrimary: true })
|
|
public id: number
|
|
|
|
@column.dateTime({ autoCreate: true })
|
|
public createdAt: DateTime
|
|
|
|
@column.dateTime({ autoCreate: true, autoUpdate: true })
|
|
public updatedAt: DateTime
|
|
|
|
@column()
|
|
public employeeId: number
|
|
|
|
@belongsTo(() => Employee)
|
|
public employee: BelongsTo<typeof Employee>
|
|
|
|
@column()
|
|
public key: string
|
|
|
|
@column()
|
|
public value: string
|
|
}
|