mirror of
https://github.com/ArthurDanjou/artdanj-api.git
synced 2026-01-30 11:27:50 +01:00
24
app/Models/Announce.ts
Normal file
24
app/Models/Announce.ts
Normal file
@@ -0,0 +1,24 @@
|
||||
import {DateTime} from 'luxon'
|
||||
import {BaseModel, BelongsTo, belongsTo, column, HasOne, hasOne} from '@ioc:Adonis/Lucid/Orm'
|
||||
import File from "App/Models/File";
|
||||
import Translation from "App/Models/Translation";
|
||||
|
||||
export default class Announce extends BaseModel {
|
||||
@column({ isPrimary: true })
|
||||
public id: number
|
||||
|
||||
@belongsTo(() => Translation)
|
||||
public message: BelongsTo<typeof Translation>
|
||||
|
||||
@column()
|
||||
public messageId: number
|
||||
|
||||
@hasOne(() => File)
|
||||
public cover: HasOne<typeof File>
|
||||
|
||||
@column.dateTime({ autoCreate: true })
|
||||
public createdAt: DateTime
|
||||
|
||||
@column.dateTime({ autoCreate: true, autoUpdate: true })
|
||||
public updatedAt: DateTime
|
||||
}
|
||||
Reference in New Issue
Block a user