mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-03-15 09:41:47 +00:00
Add explicit type annotations to nullable columns
TypeORM can't correctly infer the data type on properties with a `| null` type. This commit adds explicit type annotations. See also https://github.com/typeorm/typeorm/issues/2567#issuecomment-408599335 Signed-off-by: David Mehren <git@herrmehren.de>
This commit is contained in:
parent
80d8ce901b
commit
246d053b68
5 changed files with 11 additions and 0 deletions
|
@ -37,11 +37,13 @@ export class AuthToken {
|
||||||
|
|
||||||
@Column({
|
@Column({
|
||||||
nullable: true,
|
nullable: true,
|
||||||
|
type: 'date',
|
||||||
})
|
})
|
||||||
validUntil: Date | null;
|
validUntil: Date | null;
|
||||||
|
|
||||||
@Column({
|
@Column({
|
||||||
nullable: true,
|
nullable: true,
|
||||||
|
type: 'date',
|
||||||
})
|
})
|
||||||
lastUsed: Date | null;
|
lastUsed: Date | null;
|
||||||
|
|
||||||
|
|
|
@ -43,6 +43,7 @@ export class MediaUpload {
|
||||||
|
|
||||||
@Column({
|
@Column({
|
||||||
nullable: true,
|
nullable: true,
|
||||||
|
type: 'text',
|
||||||
})
|
})
|
||||||
backendData: BackendData | null;
|
backendData: BackendData | null;
|
||||||
|
|
||||||
|
|
|
@ -35,6 +35,7 @@ export class Note {
|
||||||
@Column({
|
@Column({
|
||||||
unique: true,
|
unique: true,
|
||||||
nullable: true,
|
nullable: true,
|
||||||
|
type: 'text',
|
||||||
})
|
})
|
||||||
alias: string | null;
|
alias: string | null;
|
||||||
@OneToMany(
|
@OneToMany(
|
||||||
|
@ -70,10 +71,12 @@ export class Note {
|
||||||
|
|
||||||
@Column({
|
@Column({
|
||||||
nullable: true,
|
nullable: true,
|
||||||
|
type: 'text',
|
||||||
})
|
})
|
||||||
description: string | null;
|
description: string | null;
|
||||||
@Column({
|
@Column({
|
||||||
nullable: true,
|
nullable: true,
|
||||||
|
type: 'text',
|
||||||
})
|
})
|
||||||
title: string | null;
|
title: string | null;
|
||||||
|
|
||||||
|
|
|
@ -38,16 +38,19 @@ export class Identity {
|
||||||
|
|
||||||
@Column({
|
@Column({
|
||||||
nullable: true,
|
nullable: true,
|
||||||
|
type: 'text',
|
||||||
})
|
})
|
||||||
providerUserId: string | null;
|
providerUserId: string | null;
|
||||||
|
|
||||||
@Column({
|
@Column({
|
||||||
nullable: true,
|
nullable: true,
|
||||||
|
type: 'text',
|
||||||
})
|
})
|
||||||
oAuthAccessToken: string | null;
|
oAuthAccessToken: string | null;
|
||||||
|
|
||||||
@Column({
|
@Column({
|
||||||
nullable: true,
|
nullable: true,
|
||||||
|
type: 'text',
|
||||||
})
|
})
|
||||||
passwordHash: string | null;
|
passwordHash: string | null;
|
||||||
}
|
}
|
||||||
|
|
|
@ -40,11 +40,13 @@ export class User {
|
||||||
|
|
||||||
@Column({
|
@Column({
|
||||||
nullable: true,
|
nullable: true,
|
||||||
|
type: 'text',
|
||||||
})
|
})
|
||||||
photo: string | null;
|
photo: string | null;
|
||||||
|
|
||||||
@Column({
|
@Column({
|
||||||
nullable: true,
|
nullable: true,
|
||||||
|
type: 'text',
|
||||||
})
|
})
|
||||||
email: string | null;
|
email: string | null;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue