mirror of
https://github.com/paricafe/misskey.git
synced 2024-12-04 20:56:44 -06:00
792622aead
* wip * wip * wip * wip * Update RepositoryModule.ts * wip * wip * wip * Revert "wip" This reverts commit c1c13b37d2aaf3c65bc148212da302b0eb7868bf.
53 lines
1.1 KiB
TypeScript
53 lines
1.1 KiB
TypeScript
/*
|
|
* SPDX-FileCopyrightText: syuilo and other misskey contributors
|
|
* SPDX-License-Identifier: AGPL-3.0-only
|
|
*/
|
|
|
|
import { Entity, Index, JoinColumn, Column, ManyToOne, PrimaryColumn } from 'typeorm';
|
|
import { id } from '../id.js';
|
|
import { mutedNoteReasons } from '../../types.js';
|
|
import { MiNote } from './Note.js';
|
|
import { MiUser } from './User.js';
|
|
|
|
@Entity('muted_note')
|
|
@Index(['noteId', 'userId'], { unique: true })
|
|
export class MiMutedNote {
|
|
@PrimaryColumn(id())
|
|
public id: string;
|
|
|
|
@Index()
|
|
@Column({
|
|
...id(),
|
|
comment: 'The note ID.',
|
|
})
|
|
public noteId: MiNote['id'];
|
|
|
|
@ManyToOne(type => MiNote, {
|
|
onDelete: 'CASCADE',
|
|
})
|
|
@JoinColumn()
|
|
public note: MiNote | null;
|
|
|
|
@Index()
|
|
@Column({
|
|
...id(),
|
|
comment: 'The user ID.',
|
|
})
|
|
public userId: MiUser['id'];
|
|
|
|
@ManyToOne(type => MiUser, {
|
|
onDelete: 'CASCADE',
|
|
})
|
|
@JoinColumn()
|
|
public user: MiUser | null;
|
|
|
|
/**
|
|
* ミュートされた理由。
|
|
*/
|
|
@Index()
|
|
@Column('enum', {
|
|
enum: mutedNoteReasons,
|
|
comment: 'The reason of the MutedNote.',
|
|
})
|
|
public reason: typeof mutedNoteReasons[number];
|
|
}
|