mirror of
https://github.com/ArthurDanjou/artdanj-api.git
synced 2026-01-14 12:14:33 +01:00
Working on v3
This commit is contained in:
24
app/Models/GoldenMessage.ts
Normal file
24
app/Models/GoldenMessage.ts
Normal file
@@ -0,0 +1,24 @@
|
||||
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
|
||||
}
|
||||
@@ -10,6 +10,9 @@ export default class User extends BaseModel {
|
||||
@column({ isPrimary: true })
|
||||
public id: number
|
||||
|
||||
@column()
|
||||
public username: string
|
||||
|
||||
@column()
|
||||
public email: string
|
||||
|
||||
|
||||
Reference in New Issue
Block a user