mirror of
https://codeberg.org/yeentown/barkey.git
synced 2025-07-07 20:44:34 +00:00
remove report -> profile relations to avoid TypeORM bug https://github.com/typeorm/typeorm/issues/10469
This commit is contained in:
parent
16891f8224
commit
b1876bf06e
2 changed files with 3 additions and 25 deletions
|
@ -5,7 +5,6 @@
|
||||||
|
|
||||||
import { PrimaryColumn, Entity, Index, JoinColumn, Column, ManyToOne } from 'typeorm';
|
import { PrimaryColumn, Entity, Index, JoinColumn, Column, ManyToOne } from 'typeorm';
|
||||||
import { MiInstance } from '@/models/Instance.js';
|
import { MiInstance } from '@/models/Instance.js';
|
||||||
import { MiUserProfile } from '@/models/UserProfile.js';
|
|
||||||
import { id } from './util/id.js';
|
import { id } from './util/id.js';
|
||||||
import { MiUser } from './User.js';
|
import { MiUser } from './User.js';
|
||||||
|
|
||||||
|
@ -26,13 +25,6 @@ export class MiAbuseUserReport {
|
||||||
@JoinColumn()
|
@JoinColumn()
|
||||||
public targetUser: MiUser | null;
|
public targetUser: MiUser | null;
|
||||||
|
|
||||||
@ManyToOne(() => MiUserProfile, {
|
|
||||||
onDelete: 'CASCADE',
|
|
||||||
createForeignKeyConstraints: false,
|
|
||||||
})
|
|
||||||
@JoinColumn({ name: 'targetUserId', referencedColumnName: 'userId' })
|
|
||||||
public targetUserProfile: MiUserProfile | null;
|
|
||||||
|
|
||||||
@Index()
|
@Index()
|
||||||
@Column(id())
|
@Column(id())
|
||||||
public reporterId: MiUser['id'];
|
public reporterId: MiUser['id'];
|
||||||
|
@ -43,13 +35,6 @@ export class MiAbuseUserReport {
|
||||||
@JoinColumn()
|
@JoinColumn()
|
||||||
public reporter: MiUser | null;
|
public reporter: MiUser | null;
|
||||||
|
|
||||||
@ManyToOne(() => MiUserProfile, {
|
|
||||||
onDelete: 'CASCADE',
|
|
||||||
createForeignKeyConstraints: false,
|
|
||||||
})
|
|
||||||
@JoinColumn({ name: 'reporterId', referencedColumnName: 'userId' })
|
|
||||||
public reporterProfile: MiUserProfile | null;
|
|
||||||
|
|
||||||
@Column({
|
@Column({
|
||||||
...id(),
|
...id(),
|
||||||
nullable: true,
|
nullable: true,
|
||||||
|
@ -62,13 +47,6 @@ export class MiAbuseUserReport {
|
||||||
@JoinColumn()
|
@JoinColumn()
|
||||||
public assignee: MiUser | null;
|
public assignee: MiUser | null;
|
||||||
|
|
||||||
@ManyToOne(() => MiUserProfile, {
|
|
||||||
onDelete: 'CASCADE',
|
|
||||||
createForeignKeyConstraints: false,
|
|
||||||
})
|
|
||||||
@JoinColumn({ name: 'assigneeId', referencedColumnName: 'userId' })
|
|
||||||
public assigneeProfile: MiUserProfile | null;
|
|
||||||
|
|
||||||
@Index()
|
@Index()
|
||||||
@Column('boolean', {
|
@Column('boolean', {
|
||||||
default: false,
|
default: false,
|
||||||
|
|
|
@ -122,12 +122,12 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
|
||||||
super(meta, paramDef, async (ps, me) => {
|
super(meta, paramDef, async (ps, me) => {
|
||||||
const query = this.queryService.makePaginationQuery(this.abuseUserReportsRepository.createQueryBuilder('report'), ps.sinceId, ps.untilId)
|
const query = this.queryService.makePaginationQuery(this.abuseUserReportsRepository.createQueryBuilder('report'), ps.sinceId, ps.untilId)
|
||||||
.leftJoinAndSelect('report.targetUser', 'targetUser')
|
.leftJoinAndSelect('report.targetUser', 'targetUser')
|
||||||
.leftJoinAndSelect('report.targetUserProfile', 'targetUserProfile')
|
.leftJoinAndSelect('targetUser.userProfile', 'targetUserProfile')
|
||||||
.leftJoinAndSelect('report.targetUserInstance', 'targetUserInstance')
|
.leftJoinAndSelect('report.targetUserInstance', 'targetUserInstance')
|
||||||
.leftJoinAndSelect('report.reporter', 'reporter')
|
.leftJoinAndSelect('report.reporter', 'reporter')
|
||||||
.leftJoinAndSelect('report.reporterProfile', 'reporterProfile')
|
.leftJoinAndSelect('reporter.userProfile', 'reporterProfile')
|
||||||
.leftJoinAndSelect('report.assignee', 'assignee')
|
.leftJoinAndSelect('report.assignee', 'assignee')
|
||||||
.leftJoinAndSelect('report.assigneeProfile', 'assigneeProfile')
|
.leftJoinAndSelect('assignee.userProfile', 'assigneeProfile')
|
||||||
;
|
;
|
||||||
|
|
||||||
switch (ps.state) {
|
switch (ps.state) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue