diff --git a/db/migration/1696940352033-PostsGdocsLinksLongerTargetField.ts b/db/migration/1696940352033-PostsGdocsLinksLongerTargetField.ts new file mode 100644 index 00000000000..288498b6c3f --- /dev/null +++ b/db/migration/1696940352033-PostsGdocsLinksLongerTargetField.ts @@ -0,0 +1,19 @@ +import { MigrationInterface, QueryRunner } from "typeorm" + +export class PostsGdocsLinksLongerTargetField1696940352033 + implements MigrationInterface +{ + public async up(queryRunner: QueryRunner): Promise { + queryRunner.query( + `ALTER TABLE posts_gdocs_links + MODIFY target TEXT CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs NOT NULL;` + ) + } + + public async down(queryRunner: QueryRunner): Promise { + queryRunner.query( + `ALTER TABLE posts_gdocs_links + MODIFY target varchar(2047) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs NOT NULL;` + ) + } +}