From 119bb553bc9ff9f9f1778edb85166d7c74b1816b Mon Sep 17 00:00:00 2001 From: syuilo Date: Sun, 20 Aug 2023 13:35:27 +0900 Subject: [PATCH] Update Event.ts --- packages/backend/src/models/entities/Event.ts | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/packages/backend/src/models/entities/Event.ts b/packages/backend/src/models/entities/Event.ts index f06669dd53..1fe9bb1864 100644 --- a/packages/backend/src/models/entities/Event.ts +++ b/packages/backend/src/models/entities/Event.ts @@ -1,19 +1,19 @@ import { Entity, Index, Column, PrimaryColumn, OneToOne, JoinColumn } from 'typeorm'; import { id } from '../id.js'; import { noteVisibilities } from '../../types.js'; -import { Note } from './Note.js'; -import type { User } from './User.js'; +import { MiNote } from './Note.js'; +import type { MiUser } from './User.js'; -@Entity() -export class Event { +@Entity('event') +export class MiEvent { @PrimaryColumn(id()) - public noteId: Note['id']; + public noteId: MiNote['id']; - @OneToOne(type => Note, { + @OneToOne(type => MiNote, { onDelete: 'CASCADE', }) @JoinColumn() - public note: Note | null; + public note: MiNote | null; @Index() @Column('timestamp with time zone', { @@ -55,7 +55,7 @@ export class Event { ...id(), comment: '[Denormalized]', }) - public userId: User['id']; + public userId: MiUser['id']; @Index() @Column('varchar', {