mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-05-16 16:14:43 -04:00
Add Author property to Session & User
The DB schema was updated in 0d6c3002
,
this adds the new author property to
the Session and User entities.
Signed-off-by: David Mehren <git@herrmehren.de>
This commit is contained in:
parent
1dc6db24a9
commit
8040f47d00
2 changed files with 9 additions and 1 deletions
|
@ -5,7 +5,8 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { ISession } from 'connect-typeorm';
|
import { ISession } from 'connect-typeorm';
|
||||||
import { Column, Entity, Index, PrimaryColumn } from 'typeorm';
|
import { Column, Entity, Index, ManyToOne, PrimaryColumn } from 'typeorm';
|
||||||
|
import { Author } from '../authors/author.entity';
|
||||||
|
|
||||||
@Entity()
|
@Entity()
|
||||||
export class Session implements ISession {
|
export class Session implements ISession {
|
||||||
|
@ -18,4 +19,7 @@ export class Session implements ISession {
|
||||||
|
|
||||||
@Column('text')
|
@Column('text')
|
||||||
public json = '';
|
public json = '';
|
||||||
|
|
||||||
|
@ManyToOne(() => Author, (author) => author.sessions)
|
||||||
|
author: Author;
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,6 +12,7 @@ import {
|
||||||
UpdateDateColumn,
|
UpdateDateColumn,
|
||||||
} from 'typeorm';
|
} from 'typeorm';
|
||||||
import { Column, OneToMany } from 'typeorm';
|
import { Column, OneToMany } from 'typeorm';
|
||||||
|
import { Author } from '../authors/author.entity';
|
||||||
import { Note } from '../notes/note.entity';
|
import { Note } from '../notes/note.entity';
|
||||||
import { AuthToken } from '../auth/auth-token.entity';
|
import { AuthToken } from '../auth/auth-token.entity';
|
||||||
import { Identity } from './identity.entity';
|
import { Identity } from './identity.entity';
|
||||||
|
@ -68,6 +69,9 @@ export class User {
|
||||||
@OneToMany((_) => MediaUpload, (mediaUpload) => mediaUpload.user)
|
@OneToMany((_) => MediaUpload, (mediaUpload) => mediaUpload.user)
|
||||||
mediaUploads: MediaUpload[];
|
mediaUploads: MediaUpload[];
|
||||||
|
|
||||||
|
@OneToMany(() => Author, (author) => author.user)
|
||||||
|
authors: Author[];
|
||||||
|
|
||||||
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
||||||
private constructor() {}
|
private constructor() {}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue