mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2024-12-29 05:33:28 +00:00
Update Revision database schema
Still uses the old schema, should probably be changed Signed-off-by: David Mehren <git@herrmehren.de>
This commit is contained in:
parent
e490ecba36
commit
9a545bb394
1 changed files with 41 additions and 2 deletions
|
@ -1,11 +1,50 @@
|
|||
import { Entity, PrimaryGeneratedColumn } from 'typeorm';
|
||||
import {
|
||||
Column,
|
||||
CreateDateColumn,
|
||||
Entity,
|
||||
ManyToOne,
|
||||
PrimaryGeneratedColumn,
|
||||
UpdateDateColumn,
|
||||
} from 'typeorm';
|
||||
import { Note } from '../notes/note.entity';
|
||||
|
||||
@Entity()
|
||||
export class Revision {
|
||||
//TODO: Still missing many properties
|
||||
//TODO: This is the old schema, we probably want to change it
|
||||
@PrimaryGeneratedColumn('uuid')
|
||||
id: string;
|
||||
|
||||
@Column({
|
||||
type: 'text',
|
||||
})
|
||||
patch: string;
|
||||
|
||||
@Column({
|
||||
type: 'text',
|
||||
})
|
||||
lastContent: string;
|
||||
|
||||
@Column({
|
||||
type: 'text',
|
||||
})
|
||||
content: string;
|
||||
|
||||
@Column()
|
||||
length: number;
|
||||
|
||||
@Column({ type: 'text' })
|
||||
authorship: string;
|
||||
|
||||
@CreateDateColumn()
|
||||
createdAt: Date;
|
||||
|
||||
@UpdateDateColumn()
|
||||
updatedAt: Date;
|
||||
|
||||
@ManyToOne(
|
||||
_ => Note,
|
||||
note => note.revisions,
|
||||
{ onDelete: 'CASCADE' },
|
||||
)
|
||||
note: Note;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue