darkbasic-accounts-typeorm
Version:
TypeORM adaptor for accounts
43 lines (32 loc) • 809 B
text/typescript
import {
Entity,
Column,
ManyToOne,
PrimaryGeneratedColumn,
UpdateDateColumn,
CreateDateColumn,
} from 'typeorm';
import { User } from './User';
()
export class UserSession {
('uuid')
public id!: string;
(() => User, (user) => user.sessions, { onDelete: 'CASCADE' })
public user!: User;
()
public token!: string;
()
public valid!: boolean;
({ type: 'text', nullable: true })
public userAgent?: string | null;
({ type: 'text', nullable: true })
public ip?: string | null;
('jsonb', { nullable: true })
public extra?: object;
()
public createdAt!: string;
()
public updatedAt!: string;
({ nullable: true })
public userId!: string;
}