ff-admin-server/src/migrations/1742207245862-memberPrintoutTemplates.ts

21 lines
767 B
TypeScript
Raw Normal View History

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