hotfix: insert or update with postgres

This commit is contained in:
Julian Krauser 2025-03-24 09:19:11 +01:00
parent 1f5ddc05d2
commit eb4db01b27
11 changed files with 43 additions and 32 deletions

View file

@ -106,7 +106,7 @@ export class CreateSchema1738166167472 implements MigrationInterface {
.insert()
.into(templateUsage)
.values([{ scope: "newsletter" }, { scope: "protocol" }, { scope: "member.list" }])
.orUpdate(["headerId", "bodyId", "footerId", "headerHeight", "footerHeight"], ["scope"])
.orIgnore()
.execute();
await queryRunner.createTable(protocol_table, true, true, true);

View file

@ -11,7 +11,7 @@ export class TemplatesAndProtocolSort1742549956787 implements MigrationInterface
.insert()
.into(templateUsage)
.values([{ scope: "member" }])
.orUpdate(["headerId", "bodyId", "footerId", "headerHeight", "footerHeight"], ["scope"])
.orIgnore()
.execute();
await queryRunner.manager
@ -47,7 +47,7 @@ export class TemplatesAndProtocolSort1742549956787 implements MigrationInterface
.insert()
.into(templateUsage)
.values([{ scope: "member.list" }])
.orUpdate(["headerId", "bodyId", "footerId", "headerHeight", "footerHeight"], ["scope"])
.orIgnore()
.execute();
await queryRunner.manager.createQueryBuilder().delete().from(templateUsage).where({ scope: "member" }).execute();