Implement User entity.

This commit implements the User entity according to the database schema and adds the Identity and AuthToken entities.

Signed-off-by: David Mehren <git@herrmehren.de>
This commit is contained in:
David Mehren 2020-08-13 20:26:47 +02:00
parent 6bee3b16cf
commit 2654f1fa36
No known key found for this signature in database
GPG key ID: 185982BA4C42B7C3
4 changed files with 117 additions and 2 deletions

View file

@ -0,0 +1,22 @@
import {
Column,
Entity,
ManyToOne,
PrimaryGeneratedColumn,
} from 'typeorm/index';
import { User } from './user.entity';
@Entity()
export class AuthToken {
@PrimaryGeneratedColumn()
id: number;
@ManyToOne(
_ => User,
user => user.authToken,
)
user: User;
@Column()
accessToken: string;
}