mirror of
https://github.com/misskey-dev/misskey.git
synced 2024-12-19 18:00:31 +01:00
c2370a1be6
* chore: Add the SPDX information to each file Add copyright and licensing information as defined in version 3.0 of the REUSE Specification. * tweak format --------- Co-authored-by: syuilo <Syuilotan@yahoo.co.jp>
53 lines
1 KiB
TypeScript
53 lines
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 { Note } from './Note.js';
|
|
import { User } from './User.js';
|
|
|
|
@Entity()
|
|
@Index(['noteId', 'userId'], { unique: true })
|
|
export class MutedNote {
|
|
@PrimaryColumn(id())
|
|
public id: string;
|
|
|
|
@Index()
|
|
@Column({
|
|
...id(),
|
|
comment: 'The note ID.',
|
|
})
|
|
public noteId: Note['id'];
|
|
|
|
@ManyToOne(type => Note, {
|
|
onDelete: 'CASCADE',
|
|
})
|
|
@JoinColumn()
|
|
public note: Note | null;
|
|
|
|
@Index()
|
|
@Column({
|
|
...id(),
|
|
comment: 'The user ID.',
|
|
})
|
|
public userId: User['id'];
|
|
|
|
@ManyToOne(type => User, {
|
|
onDelete: 'CASCADE',
|
|
})
|
|
@JoinColumn()
|
|
public user: User | null;
|
|
|
|
/**
|
|
* ミュートされた理由。
|
|
*/
|
|
@Index()
|
|
@Column('enum', {
|
|
enum: mutedNoteReasons,
|
|
comment: 'The reason of the MutedNote.',
|
|
})
|
|
public reason: typeof mutedNoteReasons[number];
|
|
}
|