forked from FoundKeyGang/FoundKey
add column: muted types in thread
This commit is contained in:
parent
26449d4944
commit
35fd970c4a
4 changed files with 24 additions and 0 deletions
|
@ -0,0 +1,13 @@
|
|||
export class threadMuteNotifications1655793461890 {
|
||||
name = 'threadMuteNotifications1655793461890'
|
||||
|
||||
async up(queryRunner) {
|
||||
await queryRunner.query(`CREATE TYPE "public"."note_thread_muting_mutingnotificationtypes_enum" AS ENUM('mention', 'reply', 'renote', 'quote', 'reaction', 'pollVote', 'pollEnded')`);
|
||||
await queryRunner.query(`ALTER TABLE "note_thread_muting" ADD "mutingNotificationTypes" "public"."note_thread_muting_mutingnotificationtypes_enum" array NOT NULL DEFAULT '{}'`);
|
||||
}
|
||||
|
||||
async down(queryRunner) {
|
||||
await queryRunner.query(`ALTER TABLE "note_thread_muting" DROP COLUMN "mutingNotificationTypes"`);
|
||||
await queryRunner.query(`DROP TYPE "public"."note_thread_muting_mutingnotificationtypes_enum"`);
|
||||
}
|
||||
}
|
|
@ -1,4 +1,5 @@
|
|||
import { PrimaryColumn, Entity, Index, JoinColumn, Column, ManyToOne } from 'typeorm';
|
||||
import { noteNotificationTypes } from 'foundkey-js';
|
||||
import { id } from '../id.js';
|
||||
import { User } from './user.js';
|
||||
import { Note } from './note.js';
|
||||
|
@ -30,4 +31,11 @@ export class NoteThreadMuting {
|
|||
length: 256,
|
||||
})
|
||||
public threadId: string;
|
||||
|
||||
@Column('enum', {
|
||||
enum: noteNotificationTypes,
|
||||
array: true,
|
||||
default: [],
|
||||
})
|
||||
public mutingNotificationTypes: typeof notificationTypes[number][];
|
||||
}
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
export const notificationTypes = ['follow', 'mention', 'reply', 'renote', 'quote', 'reaction', 'pollVote', 'pollEnded', 'receiveFollowRequest', 'followRequestAccepted', 'groupInvited', 'app'] as const;
|
||||
|
||||
export const noteNotificationTypes = ['mention', 'reply', 'renote', 'quote', 'reaction', 'pollVote', 'pollEnded'] as const;
|
||||
|
||||
export const mutedNoteReasons = ['word', 'manual', 'spam', 'other'] as const;
|
||||
|
||||
export const ffVisibility = ['public', 'followers', 'private'] as const;
|
||||
|
|
|
@ -10,6 +10,7 @@ export {
|
|||
export {
|
||||
permissions,
|
||||
notificationTypes,
|
||||
noteNotificationTypes,
|
||||
mutedNoteReasons,
|
||||
ffVisibility,
|
||||
} from './consts.js';
|
||||
|
|
Loading…
Reference in a new issue