import { MigrationInterface, QueryRunner } from "typeorm"; import { templateUsage } from "../entity/configuration/templateUsage"; export class MemberPrintoutTemplates1742207245862 implements MigrationInterface { name = "MemberPrintoutTemplates1742207245862"; public async up(queryRunner: QueryRunner): Promise { await queryRunner.manager .createQueryBuilder() .insert() .into(templateUsage) .values([{ scope: "member" }]) .orUpdate(["headerId", "bodyId", "footerId", "headerHeight", "footerHeight"], ["scope"]) .execute(); } public async down(queryRunner: QueryRunner): Promise { await queryRunner.manager.createQueryBuilder().delete().from(templateUsage).where({ scope: "member" }).execute(); } }