refactor: prefix Mi for all entities (#11719)
* wip
* wip
* wip
* wip
* Update RepositoryModule.ts
* wip
* wip
* wip
* Revert "wip"
This reverts commit c1c13b37d2
.
This commit is contained in:
@@ -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)) {
|
||||
|
Reference in New Issue
Block a user