mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2024-11-27 12:08:02 -05:00
Fix types for foreign keys
Signed-off-by: David Mehren <dmehren1@gmail.com>
This commit is contained in:
parent
1d4107fe90
commit
0c078f5266
3 changed files with 4 additions and 5 deletions
|
@ -16,7 +16,7 @@ export class Author extends Model<Author> {
|
||||||
|
|
||||||
@ForeignKey(() => Note)
|
@ForeignKey(() => Note)
|
||||||
@NoteUserIndex
|
@NoteUserIndex
|
||||||
@Column
|
@Column(DataType.UUID)
|
||||||
noteId: string;
|
noteId: string;
|
||||||
|
|
||||||
@BelongsTo(() => Note, { foreignKey: 'noteId', onDelete: 'CASCADE', constraints: false, hooks: true })
|
@BelongsTo(() => Note, { foreignKey: 'noteId', onDelete: 'CASCADE', constraints: false, hooks: true })
|
||||||
|
@ -24,7 +24,7 @@ export class Author extends Model<Author> {
|
||||||
|
|
||||||
@ForeignKey(() => User)
|
@ForeignKey(() => User)
|
||||||
@NoteUserIndex
|
@NoteUserIndex
|
||||||
@Column
|
@Column(DataType.UUID)
|
||||||
userId: string;
|
userId: string;
|
||||||
|
|
||||||
@BelongsTo(() => User, { foreignKey: 'userId', onDelete: 'CASCADE', constraints: false, hooks: true })
|
@BelongsTo(() => User, { foreignKey: 'userId', onDelete: 'CASCADE', constraints: false, hooks: true })
|
||||||
|
|
|
@ -94,7 +94,7 @@ export class Revision extends Model<Revision> {
|
||||||
}
|
}
|
||||||
|
|
||||||
@ForeignKey(() => Note)
|
@ForeignKey(() => Note)
|
||||||
@Column
|
@Column(DataType.UUID)
|
||||||
noteId: string
|
noteId: string
|
||||||
|
|
||||||
@BelongsTo(() => Note, { foreignKey: 'noteId', constraints: false, onDelete: 'CASCADE', hooks: true })
|
@BelongsTo(() => Note, { foreignKey: 'noteId', constraints: false, onDelete: 'CASCADE', hooks: true })
|
||||||
|
|
|
@ -31,8 +31,7 @@ export class User extends Model<User> {
|
||||||
@Column(DataType.TEXT)
|
@Column(DataType.TEXT)
|
||||||
refreshToken: string;
|
refreshToken: string;
|
||||||
|
|
||||||
@IsUUID(4)
|
@Column(DataType.UUID)
|
||||||
@Column
|
|
||||||
deleteToken: string;
|
deleteToken: string;
|
||||||
|
|
||||||
@IsEmail
|
@IsEmail
|
||||||
|
|
Loading…
Reference in a new issue