diff options
| author | syuilo <Syuilotan@yahoo.co.jp> | 2023-09-29 18:11:30 +0900 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-09-29 18:11:30 +0900 |
| commit | 7adc8fcaf5e7a57edfd2c197fcccb510425bd82c (patch) | |
| tree | e60179e48010b0a389f87687e934f71ead92b27f /packages/backend/src/models | |
| parent | Merge pull request #11898 from misskey-dev/develop (diff) | |
| parent | fix (diff) | |
| download | misskey-7adc8fcaf5e7a57edfd2c197fcccb510425bd82c.tar.gz misskey-7adc8fcaf5e7a57edfd2c197fcccb510425bd82c.tar.bz2 misskey-7adc8fcaf5e7a57edfd2c197fcccb510425bd82c.zip | |
Merge pull request #11920 from misskey-dev/develop
Release: 2023.9.2
Diffstat (limited to 'packages/backend/src/models')
| -rw-r--r-- | packages/backend/src/models/Note.ts | 5 | ||||
| -rw-r--r-- | packages/backend/src/models/UserProfile.ts | 28 | ||||
| -rw-r--r-- | packages/backend/src/models/json-schema/note.ts | 7 | ||||
| -rw-r--r-- | packages/backend/src/models/json-schema/user.ts | 10 |
4 files changed, 33 insertions, 17 deletions
diff --git a/packages/backend/src/models/Note.ts b/packages/backend/src/models/Note.ts index ed86d4549e..f396a0cd7a 100644 --- a/packages/backend/src/models/Note.ts +++ b/packages/backend/src/models/Note.ts @@ -24,6 +24,11 @@ export class MiNote { }) public createdAt: Date; + @Column('timestamp with time zone', { + default: null, + }) + public updatedAt: Date | null; + @Index() @Column({ ...id(), diff --git a/packages/backend/src/models/UserProfile.ts b/packages/backend/src/models/UserProfile.ts index e4405c9da7..d6d85c5609 100644 --- a/packages/backend/src/models/UserProfile.ts +++ b/packages/backend/src/models/UserProfile.ts @@ -8,6 +8,7 @@ import { obsoleteNotificationTypes, ffVisibility, notificationTypes } from '@/ty import { id } from './util/id.js'; import { MiUser } from './User.js'; import { MiPage } from './Page.js'; +import { MiUserList } from './UserList.js'; // TODO: このテーブルで管理している情報すべてレジストリで管理するようにしても良いかも // ただ、「emailVerified が true なユーザーを find する」のようなクエリは書けなくなるからウーン @@ -222,16 +223,25 @@ export class MiUserProfile { }) public mutedInstances: string[]; - @Column('enum', { - enum: [ - ...notificationTypes, - // マイグレーションで削除が困難なので古いenumは残しておく - ...obsoleteNotificationTypes, - ], - array: true, - default: [], + @Column('jsonb', { + default: {}, }) - public mutingNotificationTypes: typeof notificationTypes[number][]; + public notificationRecieveConfig: { + [notificationType in typeof notificationTypes[number]]?: { + type: 'all'; + } | { + type: 'never'; + } | { + type: 'following'; + } | { + type: 'follower'; + } | { + type: 'mutualFollow'; + } | { + type: 'list'; + userListId: MiUserList['id']; + }; + }; @Column('varchar', { length: 32, array: true, default: '{}', diff --git a/packages/backend/src/models/json-schema/note.ts b/packages/backend/src/models/json-schema/note.ts index eb744aa109..ad0cb3c45d 100644 --- a/packages/backend/src/models/json-schema/note.ts +++ b/packages/backend/src/models/json-schema/note.ts @@ -17,6 +17,11 @@ export const packedNoteSchema = { optional: false, nullable: false, format: 'date-time', }, + updatedAt: { + type: 'string', + optional: true, nullable: true, + format: 'date-time', + }, deletedAt: { type: 'string', optional: true, nullable: true, @@ -142,7 +147,7 @@ export const packedNoteSchema = { isSensitive: { type: 'boolean', optional: true, nullable: false, - } + }, }, }, }, diff --git a/packages/backend/src/models/json-schema/user.ts b/packages/backend/src/models/json-schema/user.ts index f15b225a30..0181ea50e8 100644 --- a/packages/backend/src/models/json-schema/user.ts +++ b/packages/backend/src/models/json-schema/user.ts @@ -387,13 +387,9 @@ export const packedMeDetailedOnlySchema = { nullable: false, optional: false, }, }, - mutingNotificationTypes: { - type: 'array', - nullable: true, optional: false, - items: { - type: 'string', - nullable: false, optional: false, - }, + notificationRecieveConfig: { + type: 'object', + nullable: false, optional: false, }, emailNotificationTypes: { type: 'array', |