mirror of
https://github.com/ArthurDanjou/artdanj-api.git
synced 2026-01-14 12:14:33 +01:00
25 lines
590 B
TypeScript
25 lines
590 B
TypeScript
import { DateTime } from 'luxon'
|
|
import {BaseModel, belongsTo, column} from '@ioc:Adonis/Lucid/Orm'
|
|
import User from "./User";
|
|
import {BelongsTo} from "@ioc:Adonis/Lucid/Relations";
|
|
|
|
export default class GoldenMessage extends BaseModel {
|
|
@column({ isPrimary: true })
|
|
public id: number
|
|
|
|
@belongsTo(() => User)
|
|
public user: BelongsTo<typeof User>
|
|
|
|
@column()
|
|
public userId: number
|
|
|
|
@column()
|
|
public message: string
|
|
|
|
@column.dateTime({ autoCreate: true })
|
|
public createdAt: DateTime
|
|
|
|
@column.dateTime({ autoCreate: true, autoUpdate: true })
|
|
public updatedAt: DateTime
|
|
}
|