1
0
Fork 1
mirror of https://example.com synced 2024-11-29 04:46:40 +09:00
firefish/packages/backend/migration/1646549089451-poll-ended-notification.js

30 lines
1.4 KiB
JavaScript
Raw Normal View History

export class pollEndedNotification1646549089451 {
2023-04-07 10:56:46 +09:00
name = "pollEndedNotification1646549089451";
2023-04-07 10:56:46 +09:00
async up(queryRunner) {
await queryRunner.query(
`ALTER TYPE "public"."notification_type_enum" RENAME TO "notification_type_enum_old"`,
);
await queryRunner.query(
`CREATE TYPE "public"."notification_type_enum" AS ENUM('follow', 'mention', 'reply', 'renote', 'quote', 'reaction', 'pollVote', 'pollEnded', 'receiveFollowRequest', 'followRequestAccepted', 'groupInvited', 'app')`,
);
await queryRunner.query(
`ALTER TABLE "notification" ALTER COLUMN "type" TYPE "public"."notification_type_enum" USING "type"::"text"::"public"."notification_type_enum"`,
);
await queryRunner.query(`DROP TYPE "public"."notification_type_enum_old"`);
}
2023-04-07 10:56:46 +09:00
async down(queryRunner) {
await queryRunner.query(
`CREATE TYPE "public"."notification_type_enum_old" AS ENUM('follow', 'mention', 'reply', 'renote', 'quote', 'reaction', 'pollVote', 'receiveFollowRequest', 'followRequestAccepted', 'groupInvited', 'app')`,
);
await queryRunner.query(
`ALTER TABLE "notification" ALTER COLUMN "type" TYPE "public"."notification_type_enum_old" USING "type"::"text"::"public"."notification_type_enum_old"`,
);
await queryRunner.query(`DROP TYPE "public"."notification_type_enum"`);
await queryRunner.query(
`ALTER TYPE "public"."notification_type_enum_old" RENAME TO "notification_type_enum"`,
);
}
}