-
Notifications
You must be signed in to change notification settings - Fork 65
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a new migration to clean up notification tables before creating n…
…ew tables
- Loading branch information
Showing
4 changed files
with
38 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import type { MigrationInterface, QueryRunner } from 'typeorm'; | ||
|
||
export class NotificationCleanup1726452966034 implements MigrationInterface { | ||
name = 'NotificationCleanup1726452966034'; | ||
|
||
public async up(queryRunner: QueryRunner): Promise<void> { | ||
await queryRunner.query( | ||
`DROP TRIGGER IF EXISTS "update_push_notification_devices_updated_at" ON "push_notification_devices"`, | ||
); | ||
await queryRunner.query( | ||
`DROP TRIGGER IF EXISTS "update_notification_subscriptions_updated_at" ON "notification_subscriptions"`, | ||
); | ||
await queryRunner.query( | ||
`DROP TYPE IF EXISTS "notification_types_name_enum" CASCADE`, | ||
); | ||
await queryRunner.query( | ||
`DROP TYPE IF EXISTS "push_notification_devices_device_type_enum" CASCADE`, | ||
); | ||
await queryRunner.query(`DROP FUNCTION IF EXISTS update_updated_at()`); | ||
await queryRunner.query( | ||
`DROP TABLE IF EXISTS "push_notification_devices" CASCADE`, | ||
); | ||
await queryRunner.query( | ||
`DROP TABLE IF EXISTS "notification_subscriptions" CASCADE`, | ||
); | ||
await queryRunner.query( | ||
`DROP TABLE IF EXISTS "notification_subscription_notification_types" CASCADE`, | ||
); | ||
await queryRunner.query( | ||
`DROP TABLE IF EXISTS "notification_types" CASCADE`, | ||
); | ||
} | ||
|
||
public async down(): Promise<void> {} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters