1688540448427-add-notifications.ts 828 B

12345678910111213141516
  1. import { MigrationInterface, QueryRunner } from 'typeorm'
  2. export class AddNotifications1688540448427 implements MigrationInterface {
  3. name = 'AddNotifications1688540448427'
  4. public async up(queryRunner: QueryRunner): Promise<void> {
  5. await queryRunner.query(
  6. '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',
  7. )
  8. }
  9. public async down(queryRunner: QueryRunner): Promise<void> {
  10. await queryRunner.query('DROP INDEX `index_notifications_on_user_uuid` ON `notifications`')
  11. await queryRunner.query('DROP TABLE `notifications`')
  12. }
  13. }