mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-05-19 09:45:37 -04:00
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:
parent
db026d6a57
commit
8689b44f59
4 changed files with 117 additions and 2 deletions
48
src/users/identity.entity.ts
Normal file
48
src/users/identity.entity.ts
Normal file
|
@ -0,0 +1,48 @@
|
|||
import {
|
||||
Column,
|
||||
CreateDateColumn,
|
||||
Entity,
|
||||
ManyToOne,
|
||||
PrimaryGeneratedColumn,
|
||||
UpdateDateColumn,
|
||||
} from 'typeorm/index';
|
||||
import { User } from './user.entity';
|
||||
|
||||
@Entity()
|
||||
export class Identity {
|
||||
@PrimaryGeneratedColumn()
|
||||
id: number;
|
||||
|
||||
@ManyToOne(
|
||||
_ => User,
|
||||
user => user.identities,
|
||||
)
|
||||
user: User;
|
||||
|
||||
@Column()
|
||||
providerName: string;
|
||||
|
||||
@Column()
|
||||
syncSource: boolean;
|
||||
|
||||
@CreateDateColumn()
|
||||
createdAt: Date;
|
||||
|
||||
@UpdateDateColumn()
|
||||
updatedAt: Date;
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
})
|
||||
providerUserId?: string;
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
})
|
||||
oAuthAccessToken?: string;
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
})
|
||||
passwordHash?: string;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue