2020-07-27 14:41:04 +00:00
|
|
|
import {Field} from '../../../orm/src/model/Field.ts'
|
|
|
|
import {Type} from '../../../orm/src/db/types.ts'
|
|
|
|
import {SessionModel} from '../../../lib/src/module.ts'
|
|
|
|
|
|
|
|
export default class Session extends SessionModel {
|
|
|
|
protected static table = 'sessions'
|
2020-07-28 00:48:44 +00:00
|
|
|
protected static key = 'session_key'
|
2020-07-27 14:41:04 +00:00
|
|
|
|
|
|
|
protected static readonly CREATED_AT = 'start_time'
|
|
|
|
protected static readonly UPDATED_AT = null // No updated at
|
|
|
|
|
2020-07-28 00:48:44 +00:00
|
|
|
@Field(Type.varchar)
|
|
|
|
protected session_key!: string
|
2020-07-27 14:41:04 +00:00
|
|
|
|
|
|
|
@Field(Type.int)
|
|
|
|
protected user_id?: number
|
|
|
|
|
|
|
|
@Field(Type.timestamp)
|
|
|
|
protected start_time!: Date
|
|
|
|
}
|