From d0ae4d06bccf109fad95efb9f2904a009b1fb1ec Mon Sep 17 00:00:00 2001 From: Rory& Date: Sun, 19 Oct 2025 18:13:54 +0200 Subject: [PATCH] Make reconicle migration not suck --- .../postgres/1760622755599-ReconcileMigrationAttempts.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/util/migration/postgres/1760622755599-ReconcileMigrationAttempts.ts b/src/util/migration/postgres/1760622755599-ReconcileMigrationAttempts.ts index d38f0d8c..73603059 100644 --- a/src/util/migration/postgres/1760622755599-ReconcileMigrationAttempts.ts +++ b/src/util/migration/postgres/1760622755599-ReconcileMigrationAttempts.ts @@ -4,7 +4,8 @@ export class ReconcileMigrationAttempts1760622755598 implements MigrationInterfa name = 'ReconcileMigrationAttempts1760622755598' public async up(queryRunner: QueryRunner): Promise { - await queryRunner.query(`ALTER TABLE "webhooks" DROP CONSTRAINT "fk_d64f38834fa676f6caa4786ddd6"`); + // doesnt work because initial setup is syncDb() + //await queryRunner.query(`ALTER TABLE "webhooks" DROP CONSTRAINT "fk_d64f38834fa676f6caa4786ddd6"`); await queryRunner.query(`ALTER TABLE "webhooks" ALTER COLUMN "source_channel_id" TYPE character varying`); await queryRunner.query(`ALTER TABLE "messages" ALTER COLUMN "username" TYPE character varying`); await queryRunner.query(`ALTER TABLE "messages" ALTER COLUMN "avatar" TYPE character varying`); @@ -47,7 +48,7 @@ export class ReconcileMigrationAttempts1760622755598 implements MigrationInterfa await queryRunner.query(`ALTER TABLE "messages" ALTER COLUMN "username" TYPE text`); await queryRunner.query(`ALTER TABLE "webhooks" ALTER COLUMN "source_channel_id" TYPE character varying(255)`); await queryRunner.query(`ALTER TABLE "webhooks" ALTER COLUMN "source_channel_id" SET DEFAULT NULL`); - await queryRunner.query(`ALTER TABLE "webhooks" ADD CONSTRAINT "fk_d64f38834fa676f6caa4786ddd6" FOREIGN KEY ("source_channel_id") REFERENCES "channels"("id") ON DELETE CASCADE ON UPDATE NO ACTION`); + // await queryRunner.query(`ALTER TABLE "webhooks" ADD CONSTRAINT "fk_d64f38834fa676f6caa4786ddd6" FOREIGN KEY ("source_channel_id") REFERENCES "channels"("id") ON DELETE CASCADE ON UPDATE NO ACTION`); } -} +} \ No newline at end of file