From 53ab01c4e2918fa6fd67ca8642efb21f5fc1a63a Mon Sep 17 00:00:00 2001 From: Rory& Date: Thu, 26 Mar 2026 15:14:18 +0100 Subject: EmbedHandlers: more configuration for embeds, switch to storing all returned embeds --- .../postgres/1772404321403-EmbedCacheMultiEmbed.ts | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 src/util/migration/postgres/1772404321403-EmbedCacheMultiEmbed.ts (limited to 'src/util/migration/postgres') diff --git a/src/util/migration/postgres/1772404321403-EmbedCacheMultiEmbed.ts b/src/util/migration/postgres/1772404321403-EmbedCacheMultiEmbed.ts new file mode 100644 index 000000000..55e80fdcf --- /dev/null +++ b/src/util/migration/postgres/1772404321403-EmbedCacheMultiEmbed.ts @@ -0,0 +1,16 @@ +import { MigrationInterface, QueryRunner } from "typeorm"; + +export class EmbedCacheCreatedAt1772404321403 implements MigrationInterface { + name = "EmbedCacheCreatedAt1772404321403"; + + public async up(queryRunner: QueryRunner): Promise { + await queryRunner.query(`ALTER TABLE "embed_cache" ALTER COLUMN "embed" DROP NOT NULL;`); + await queryRunner.query(`ALTER TABLE "embed_cache" ADD "embeds" text NULL;`); + } + + public async down(queryRunner: QueryRunner): Promise { + await queryRunner.query(`ALTER TABLE "embed_cache" DROP COLUMN "embeds"`); + await queryRunner.query(`UPDATE "embed_cache" SET "embed" = '{}' WHERE "embed" IS NULL;`); + await queryRunner.query(`ALTER TABLE "embed_cache" ALTER COLUMN "embed" SET NOT NULL;`); + } +} -- cgit 1.5.1