2020-07-21 13:20:51 +00:00
|
|
|
import {BaseEntity, Column, Entity, JoinColumn, ManyToOne, PrimaryColumn} from "typeorm";
|
|
|
|
|
|
|
|
import {User} from "./User";
|
|
|
|
|
|
|
|
@Entity({name: 'logins'})
|
|
|
|
export class Login extends BaseEntity {
|
|
|
|
|
2023-05-23 19:17:28 +00:00
|
|
|
@PrimaryColumn({type: Number})
|
2020-07-21 13:20:51 +00:00
|
|
|
public id: number;
|
|
|
|
|
|
|
|
// This is the normalized email address we use for equality and indexing.
|
2023-05-23 19:17:28 +00:00
|
|
|
@Column({type: String})
|
2020-07-21 13:20:51 +00:00
|
|
|
public email: string;
|
|
|
|
|
|
|
|
// This is how the user's email address should be displayed.
|
2023-05-23 19:17:28 +00:00
|
|
|
@Column({name: 'display_email', type: String})
|
2020-07-21 13:20:51 +00:00
|
|
|
public displayEmail: string;
|
|
|
|
|
2023-05-23 19:17:28 +00:00
|
|
|
@Column({name: 'user_id', type: Number})
|
2020-07-21 13:20:51 +00:00
|
|
|
public userId: number;
|
|
|
|
|
|
|
|
@ManyToOne(type => User)
|
|
|
|
@JoinColumn({name: 'user_id'})
|
|
|
|
public user: User;
|
|
|
|
}
|