mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2024-11-22 01:36:29 -05: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
02de7c7d54
commit
b429326b9d
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