hippofish/packages/backend/src/migration/1684494870830-EmojiSize.ts

20 lines
707 B
TypeScript
Raw Normal View History

import { MigrationInterface, QueryRunner } from "typeorm";
2023-05-20 04:26:13 +02:00
export class EmojiSize1684494870830 implements MigrationInterface {
async up(queryRunner: QueryRunner): Promise<void> {
2023-05-20 04:26:13 +02:00
await queryRunner.query(`ALTER TABLE "emoji" ADD "width" integer`);
await queryRunner.query(
`COMMENT ON COLUMN "emoji"."width" IS 'Image width'`,
);
await queryRunner.query(`ALTER TABLE "emoji" ADD "height" integer`);
await queryRunner.query(
`COMMENT ON COLUMN "emoji"."height" IS 'Image height'`,
);
}
async down(queryRunner: QueryRunner): Promise<void> {
2023-05-20 04:26:13 +02:00
await queryRunner.query(`ALTER TABLE "emoji" DROP COLUMN "height"`);
await queryRunner.query(`ALTER TABLE "emoji" DROP COLUMN "width"`);
}
}