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:
David Mehren 2020-07-26 20:55:34 +02:00
parent 02de7c7d54
commit b429326b9d
No known key found for this signature in database
GPG key ID: 185982BA4C42B7C3

View file

@ -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;
}