mirror of
https://github.com/ArthurDanjou/artdanj-api.git
synced 2026-01-31 03:48:03 +01:00
23
app/Models/GuestbookMessage.ts
Executable file
23
app/Models/GuestbookMessage.ts
Executable file
@@ -0,0 +1,23 @@
|
||||
import {DateTime} from 'luxon'
|
||||
import {BaseModel, BelongsTo, belongsTo, column} from '@ioc:Adonis/Lucid/Orm'
|
||||
import User from "App/Models/User";
|
||||
|
||||
export default class GuestbookMessage 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
|
||||
}
|
||||
Reference in New Issue
Block a user