LocChat/server/entities/user.entity.ts
2021-11-23 14:04:12 -07:00

21 lines
464 B
TypeScript

import { Entity, Column, PrimaryGeneratedColumn, OneToMany } from 'typeorm';
import { RefreshToken } from './refresh_token.entity';
@Entity()
export class User {
@PrimaryGeneratedColumn()
id: number;
@Column({ unique: true, nullable: false })
email: string;
@Column({ nullable: false })
name: string;
@Column({ nullable: false })
passwordHash: string;
@OneToMany(() => RefreshToken, (token) => token.user)
refreshTokens: RefreshToken[];
}