demo data & template usage

This commit is contained in:
Julian Krauser 2025-03-17 11:56:17 +01:00
parent 2f72cc3925
commit de5e4afffb
6 changed files with 176 additions and 8 deletions

View file

@ -0,0 +1,20 @@
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();
}
}