upd: add backend for post editing

This commit is contained in:
Mar0xy 2023-09-22 21:05:42 +02:00
parent deb8f73127
commit feec3c302b
No known key found for this signature in database
GPG key ID: 56569BBE47D2C828
16 changed files with 1310 additions and 2 deletions

View file

@ -0,0 +1,46 @@
import { Entity, JoinColumn, Column, ManyToOne, PrimaryColumn, Index } from "typeorm";
import { id } from './util/id.js';
import { MiNote } from './Note.js';
import type { MiDriveFile } from './DriveFile.js';
@Entity()
export class NoteEdit {
@PrimaryColumn(id())
public id: string;
@Index()
@Column({
...id(),
comment: "The ID of note.",
})
public noteId: MiNote["id"];
@ManyToOne((type) => MiNote, {
onDelete: "CASCADE",
})
@JoinColumn()
public note: MiNote | null;
@Column("text", {
nullable: true,
})
public text: string | null;
@Column("varchar", {
length: 512,
nullable: true,
})
public cw: string | null;
@Column({
...id(),
array: true,
default: "{}",
})
public fileIds: MiDriveFile["id"][];
@Column("timestamp with time zone", {
comment: "The updated date of the Note.",
})
public updatedAt: Date;
}