mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-05-18 17:25:16 -04:00
51 lines
797 B
TypeScript
51 lines
797 B
TypeScript
/*
|
|
* SPDX-FileCopyrightText: 2021 The HedgeDoc developers (see AUTHORS file)
|
|
*
|
|
* SPDX-License-Identifier: AGPL-3.0-only
|
|
*/
|
|
|
|
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;
|
|
}
|