diff options
Diffstat (limited to 'packages/backend/src/models/entities/UserProfile.ts')
| -rw-r--r-- | packages/backend/src/models/entities/UserProfile.ts | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/packages/backend/src/models/entities/UserProfile.ts b/packages/backend/src/models/entities/UserProfile.ts index 73535c3665..54144cb429 100644 --- a/packages/backend/src/models/entities/UserProfile.ts +++ b/packages/backend/src/models/entities/UserProfile.ts @@ -6,21 +6,21 @@ import { Entity, Column, Index, OneToOne, JoinColumn, PrimaryColumn } from 'typeorm'; import { obsoleteNotificationTypes, ffVisibility, notificationTypes } from '@/types.js'; import { id } from '../id.js'; -import { User } from './User.js'; -import { Page } from './Page.js'; +import { MiUser } from './User.js'; +import { MiPage } from './Page.js'; // TODO: このテーブルで管理している情報すべてレジストリで管理するようにしても良いかも // ただ、「emailVerified が true なユーザーを find する」のようなクエリは書けなくなるからウーン -@Entity() -export class UserProfile { +@Entity('user_profile') +export class MiUserProfile { @PrimaryColumn(id()) - public userId: User['id']; + public userId: MiUser['id']; - @OneToOne(type => User, { + @OneToOne(type => MiUser, { onDelete: 'CASCADE', }) @JoinColumn() - public user: User | null; + public user: MiUser | null; @Column('varchar', { length: 128, nullable: true, @@ -186,13 +186,13 @@ export class UserProfile { ...id(), nullable: true, }) - public pinnedPageId: Page['id'] | null; + public pinnedPageId: MiPage['id'] | null; - @OneToOne(type => Page, { + @OneToOne(type => MiPage, { onDelete: 'SET NULL', }) @JoinColumn() - public pinnedPage: Page | null; + public pinnedPage: MiPage | null; @Index() @Column('boolean', { @@ -244,7 +244,7 @@ export class UserProfile { public userHost: string | null; //#endregion - constructor(data: Partial<UserProfile>) { + constructor(data: Partial<MiUserProfile>) { if (data == null) return; for (const [k, v] of Object.entries(data)) { |