This commit is contained in:
syuilo 2023-09-23 17:06:37 +09:00
parent 013a1fd5af
commit f24e388458
3 changed files with 9 additions and 14 deletions

View File

@ -1,13 +0,0 @@
export class ModerationLogUserNoAction1695449023032 {
name = 'ModerationLogUserNoAction1695449023032'
async up(queryRunner) {
await queryRunner.query(`ALTER TABLE "moderation_log" DROP CONSTRAINT "FK_a08ad074601d204e0f69da9a954"`);
await queryRunner.query(`ALTER TABLE "moderation_log" ADD CONSTRAINT "FK_a08ad074601d204e0f69da9a954" FOREIGN KEY ("userId") REFERENCES "user"("id") ON DELETE NO ACTION ON UPDATE NO ACTION`);
}
async down(queryRunner) {
await queryRunner.query(`ALTER TABLE "moderation_log" DROP CONSTRAINT "FK_a08ad074601d204e0f69da9a954"`);
await queryRunner.query(`ALTER TABLE "moderation_log" ADD CONSTRAINT "FK_a08ad074601d204e0f69da9a954" FOREIGN KEY ("userId") REFERENCES "user"("id") ON DELETE CASCADE ON UPDATE NO ACTION`);
}
}

View File

@ -22,7 +22,7 @@ export class MiModerationLog {
public userId: MiUser['id']; public userId: MiUser['id'];
@ManyToOne(type => MiUser, { @ManyToOne(type => MiUser, {
onDelete: 'NO ACTION', onDelete: 'CASCADE',
}) })
@JoinColumn() @JoinColumn()
public user: MiUser | null; public user: MiUser | null;

View File

@ -22,6 +22,14 @@ SPDX-License-Identifier: AGPL-3.0-only
<template v-else-if="log.type === 'unsuspend'"> <template v-else-if="log.type === 'unsuspend'">
<div>{{ i18n.ts.user }}: {{ log.info.targetId }}</div> <div>{{ i18n.ts.user }}: {{ log.info.targetId }}</div>
</template> </template>
<template v-else-if="log.type === 'roleAssigned'">
<div>{{ i18n.ts.user }}: {{ log.info.userId }}</div>
<div>{{ i18n.ts.role }}: {{ log.info.roleName }} [{{ log.info.roleId }}]</div>
</template>
<template v-else-if="log.type === 'roleUnassigned'">
<div>{{ i18n.ts.user }}: {{ log.info.userId }}</div>
<div>{{ i18n.ts.role }}: {{ log.info.roleName }} [{{ log.info.roleId }}]</div>
</template>
</div> </div>
</MkFolder> </MkFolder>
</template> </template>