diff --git a/packages/backend/migration/1636697408073-remove-via-mobile.js b/packages/backend/migration/1636697408073-remove-via-mobile.js new file mode 100644 index 000000000..bb5157cf1 --- /dev/null +++ b/packages/backend/migration/1636697408073-remove-via-mobile.js @@ -0,0 +1,13 @@ +const { MigrationInterface, QueryRunner } = require("typeorm"); + +module.exports = class removeViaMobile1636697408073 { + name = 'removeViaMobile1636697408073' + + async up(queryRunner) { + await queryRunner.query(`ALTER TABLE "note" DROP COLUMN "viaMobile"`); + } + + async down(queryRunner) { + await queryRunner.query(`ALTER TABLE "note" ADD "viaMobile" boolean NOT NULL DEFAULT false`); + } +} diff --git a/packages/backend/src/models/entities/note.ts b/packages/backend/src/models/entities/note.ts index 4a5411f93..9dee25ea2 100644 --- a/packages/backend/src/models/entities/note.ts +++ b/packages/backend/src/models/entities/note.ts @@ -81,11 +81,6 @@ export class Note { @JoinColumn() public user: User | null; - @Column('boolean', { - default: false - }) - public viaMobile: boolean; - @Column('boolean', { default: false }) diff --git a/packages/backend/src/models/repositories/note.ts b/packages/backend/src/models/repositories/note.ts index 0f00c34c9..c076cb31e 100644 --- a/packages/backend/src/models/repositories/note.ts +++ b/packages/backend/src/models/repositories/note.ts @@ -230,7 +230,6 @@ export class NoteRepository extends Repository { visibility: note.visibility, localOnly: note.localOnly || undefined, visibleUserIds: note.visibility === 'specified' ? note.visibleUserIds : undefined, - viaMobile: note.viaMobile || undefined, renoteCount: note.renoteCount, repliesCount: note.repliesCount, reactions: convertLegacyReactions(note.reactions), @@ -377,10 +376,6 @@ export const packedNoteSchema = { optional: true as const, nullable: true as const, ref: 'Note' as const, }, - viaMobile: { - type: 'boolean' as const, - optional: true as const, nullable: false as const, - }, isHidden: { type: 'boolean' as const, optional: true as const, nullable: false as const, diff --git a/packages/backend/src/queue/processors/db/export-notes.ts b/packages/backend/src/queue/processors/db/export-notes.ts index bd178556d..761f4d827 100644 --- a/packages/backend/src/queue/processors/db/export-notes.ts +++ b/packages/backend/src/queue/processors/db/export-notes.ts @@ -125,7 +125,6 @@ function serialize(note: Note, poll: Poll | null = null): Record { reply, renote, cw: ps.cw, - viaMobile: ps.viaMobile, localOnly: ps.localOnly, visibility: ps.visibility, visibleUsers, diff --git a/packages/backend/src/services/note/create.ts b/packages/backend/src/services/note/create.ts index 69d854ab1..8f6c2fe3a 100644 --- a/packages/backend/src/services/note/create.ts +++ b/packages/backend/src/services/note/create.ts @@ -98,7 +98,6 @@ type Option = { renote?: Note | null; files?: DriveFile[] | null; poll?: IPoll | null; - viaMobile?: boolean | null; localOnly?: boolean | null; cw?: string | null; visibility?: string; @@ -131,7 +130,6 @@ export default async (user: { id: User['id']; username: User['username']; host: if (data.createdAt == null) data.createdAt = new Date(); if (data.visibility == null) data.visibility = 'public'; - if (data.viaMobile == null) data.viaMobile = false; if (data.localOnly == null) data.localOnly = false; if (data.channel != null) data.visibility = 'public'; if (data.channel != null) data.visibleUsers = []; @@ -478,7 +476,6 @@ async function insertNote(user: { id: User['id']; host: User['host']; }, data: O tags: tags.map(tag => normalizeForSearch(tag)), emojis, userId: user.id, - viaMobile: data.viaMobile!, localOnly: data.localOnly!, visibility: data.visibility as any, visibleUserIds: data.visibility == 'specified' diff --git a/packages/client/src/components/note-detailed.vue b/packages/client/src/components/note-detailed.vue index 8b6905a0e..755015352 100644 --- a/packages/client/src/components/note-detailed.vue +++ b/packages/client/src/components/note-detailed.vue @@ -86,7 +86,6 @@