Add maintenance mode and update announce

This commit is contained in:
2021-08-23 14:38:14 +02:00
parent bbebdf681d
commit 0c70b340a9
7 changed files with 97 additions and 29 deletions

25
app/Models/Maintenance.ts Normal file
View File

@@ -0,0 +1,25 @@
import { DateTime } from 'luxon'
import {BaseModel, BelongsTo, belongsTo, column} from '@ioc:Adonis/Lucid/Orm'
import Translation from "App/Models/Translation";
export default class Maintenance extends BaseModel {
@column({ isPrimary: true })
public id: number
@column()
public active: boolean
@belongsTo(() => Translation, {
foreignKey: 'reasonId'
})
public reason: BelongsTo<typeof Translation>
@column()
public reasonId: number
@column.dateTime({ autoCreate: true })
public createdAt: DateTime
@column.dateTime({ autoCreate: true, autoUpdate: true })
public updatedAt: DateTime
}