1688540448428-remove-notifications.ts 834 B

12345678910111213141516
  1. import { MigrationInterface, QueryRunner } from 'typeorm'
  2. export class RemoveNotifications1688540448428 implements MigrationInterface {
  3. name = 'RemoveNotifications1688540448428'
  4. public async up(queryRunner: QueryRunner): Promise<void> {
  5. await queryRunner.query('DROP INDEX `index_notifications_on_user_uuid` ON `notifications`')
  6. await queryRunner.query('DROP TABLE `notifications`')
  7. }
  8. public async down(queryRunner: QueryRunner): Promise<void> {
  9. await queryRunner.query(
  10. 'CREATE TABLE `notifications` (`uuid` varchar(36) NOT NULL, `user_uuid` varchar(36) NOT NULL, `type` varchar(36) NOT NULL, `payload` text NOT NULL, `created_at_timestamp` bigint NOT NULL, `updated_at_timestamp` bigint NOT NULL, INDEX `index_notifications_on_user_uuid` (`user_uuid`), PRIMARY KEY (`uuid`)) ENGINE=InnoDB',
  11. )
  12. }
  13. }