20 lines
767 B
TypeScript
20 lines
767 B
TypeScript
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();
|
|
}
|
|
}
|