mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-05-24 20:14:35 -04:00

TypeORM columns with `nullable: true` can be `null` at runtime. This commit ensures that the types of the corresponding properties reflect that. Signed-off-by: David Mehren <git@herrmehren.de>
53 lines
907 B
TypeScript
53 lines
907 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';
|
|
import { User } from './user.entity';
|
|
|
|
@Entity()
|
|
export class Identity {
|
|
@PrimaryGeneratedColumn()
|
|
id: number;
|
|
|
|
@ManyToOne((_) => User, (user) => user.identities, {
|
|
onDelete: 'CASCADE', // This deletes the Identity, when the associated User is deleted
|
|
})
|
|
user: User;
|
|
|
|
@Column()
|
|
providerName: string;
|
|
|
|
@Column()
|
|
syncSource: boolean;
|
|
|
|
@CreateDateColumn()
|
|
createdAt: Date;
|
|
|
|
@UpdateDateColumn()
|
|
updatedAt: Date;
|
|
|
|
@Column({
|
|
nullable: true,
|
|
})
|
|
providerUserId: string | null;
|
|
|
|
@Column({
|
|
nullable: true,
|
|
})
|
|
oAuthAccessToken: string | null;
|
|
|
|
@Column({
|
|
nullable: true,
|
|
})
|
|
passwordHash: string | null;
|
|
}
|