upd: add backend for post editing
This commit is contained in:
parent
deb8f73127
commit
feec3c302b
16 changed files with 1310 additions and 2 deletions
46
packages/backend/src/models/NoteEdit.ts
Normal file
46
packages/backend/src/models/NoteEdit.ts
Normal 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;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue