summaryrefslogtreecommitdiff
path: root/packages/backend/src/models/Note.ts
diff options
context:
space:
mode:
Diffstat (limited to 'packages/backend/src/models/Note.ts')
-rw-r--r--packages/backend/src/models/Note.ts11
1 files changed, 9 insertions, 2 deletions
diff --git a/packages/backend/src/models/Note.ts b/packages/backend/src/models/Note.ts
index 9822ec94e4..26d5c1d535 100644
--- a/packages/backend/src/models/Note.ts
+++ b/packages/backend/src/models/Note.ts
@@ -36,7 +36,7 @@ export class MiNote {
public replyId: MiNote['id'] | null;
@ManyToOne(type => MiNote, {
- onDelete: 'CASCADE',
+ createForeignKeyConstraints: false,
})
@JoinColumn()
public reply: MiNote | null;
@@ -50,7 +50,7 @@ export class MiNote {
public renoteId: MiNote['id'] | null;
@ManyToOne(type => MiNote, {
- onDelete: 'CASCADE',
+ createForeignKeyConstraints: false,
})
@JoinColumn()
public renote: MiNote | null;
@@ -114,6 +114,13 @@ export class MiNote {
})
public clippedCount: number;
+ // The number of note page blocks referencing this note.
+ // This column is used by Remote Note Cleaning and manually updated rather than automatically with triggers.
+ @Column('smallint', {
+ default: 0,
+ })
+ public pageCount: number;
+
@Column('jsonb', {
default: {},
})