You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

28 lines
700 B

import { Model, Type, Field, Relation } from '../../bundle/daton_orm.ts'
import LoginAttemptModel from './LoginAttempt.model.ts'
export default class User extends Model<User> {
protected static table = 'daton_users'
protected static key = 'user_id'
protected static readonly CREATED_AT = 'created_at'
protected static readonly UPDATED_AT = 'updated_at'
@Field(Type.int)
protected user_id?: number
@Field(Type.varchar)
protected first_name!: String
@Field(Type.varchar)
protected last_name!: String
@Field(Type.bool)
protected active!: Boolean
@Relation()
public login_attempts() {
return this.has_many(LoginAttemptModel)
}
}